struct wb_domain

本文介绍了一种名为WB域的内存管理结构,该结构用于衡量系统中不同写回操作的相对带宽,并据此分配可脏页内存。WB域通过周期计时器、锁等机制实现对写回操作的有效管理和测量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



/*
 * A wb_domain represents a domain that wb's (bdi_writeback's) belong to
 * and are measured against each other in.  There always is one global
 * domain, global_wb_domain, that every wb in the system is a member of.
 * This allows measuring the relative bandwidth of each wb to distribute
 * dirtyable memory accordingly.
 */
struct wb_domain {
spinlock_t lock;
struct fprop_global completions;
struct timer_list period_timer; /* timer for aging of completions */
unsigned long period_time;
unsigned long dirty_limit_tstamp;
unsigned long dirty_limit;

};




static inline void wb_domain_size_changed(struct wb_domain *dom)
{
spin_lock(&dom->lock);
dom->dirty_limit_tstamp = jiffies;
dom->dirty_limit = 0;
spin_unlock(&dom->lock);
}


int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
{
memset(dom, 0, sizeof(*dom));


spin_lock_init(&dom->lock);


init_timer_deferrable(&dom->period_timer);
dom->period_timer.function = writeout_period;
dom->period_timer.data = (unsigned long)dom;



dom->dirty_limit_tstamp = jiffies;


return fprop_global_init(&dom->completions, gfp);
}



int fprop_global_init(struct fprop_global *p, gfp_t gfp)
{
int err;


p->period = 0;
/* Use 1 to avoid dealing with periods with 0 events... */
err = percpu_counter_init(&p->events, 1, gfp);

if (err)
return err;
seqcount_init(&p->sequence);
return 0;
}

from sys import argv from openpyxl import load_workbook as lw import shlex import subprocess ''' Instructions: >python regulatory_excel_BDF.py <regulatory Input excel sheet> <BDF txt file> ''' script,regInput = argv #print "Regulatory Excel to BDF converter v2.0" txtFile = "regdb" #### SOME DEFS BASED ON CURRENT REGDB SIZES. MAY NEED PER CHIP CONFIG SIZES VARY PER CHIP ##### #STRUCT SIZES CC_SIZE = 14 DMN_PAIR_SIZE = 3 SUBDMN_MAP_SIZE = 2 REG_RULES_SIZE = 8 REG_DMNS_SIZE = 16 SUPER_DMN_SUBSET_SIZE = 12 REG_DMNS_6G_SIZE = 16 REG_RULES_6G_SIZE = 8 #STRUCT LENGTHS CC_LEN = 1000 DMN_PAIR_LEN = 1000 SUBDMN_MAP_LEN = 1000 REG_RULE_2G_LEN = 1000 REG_RULE_5G_LEN = 1000 REG_DMN_2G_LEN = 1000 REG_DMN_5G_LEN = 1000 SUPER_DMN_SUBSET_LEN = 1000 REG_DMN_6G_LEN = 1000 REG_RULE_6G_LEN = 1000 #print "\n" #print "Max countries supported: "+str(CC_LEN) #print "Max reg domain pairs supported: "+str(DMN_PAIR_LEN) #print "Max 2g reg domains supported: "+str(REG_DMN_2G_LEN) #print "Max 5g reg domains supported: "+str(REG_DMN_5G_LEN) #print "Max 2g rules supported: "+str(REG_RULE_2G_LEN) #print "Max 5g rules supported: "+str(REG_RULE_5G_LEN) #print "\n" def is_number(s): try: float(s) # for int, long and float except ValueError: try: complex(s) # for complex except ValueError: return False return True def clear_contents_of_column_in_sheet(ws,col): for row in ws[col+str(2)+':'+col+str(ws.max_row)]: for cell in row: cell.value = None def put_zeroes_column_in_sheet(ws,col): for row in ws[col+str(2)+':'+col+str(ws.max_row)]: for cell in row: cell.value = 0 def combine_sheets(wi,wo,wbo,find_str): wi = wbo.get_sheet_by_name(wi) wo = wbo.get_sheet_by_name(wo) for i in range(1,wo.max_row+1): if (str(wo.cell(row=i,column=1).value).find(find_str) != -1): break for j in range(1,wi.max_row): wo.cell(row=i+(j-1),colu
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值