linux/mm/backing-dev.c
<<
>>
Prefs
   1
   2#include <linux/wait.h>
   3#include <linux/backing-dev.h>
   4#include <linux/kthread.h>
   5#include <linux/freezer.h>
   6#include <linux/fs.h>
   7#include <linux/pagemap.h>
   8#include <linux/mm.h>
   9#include <linux/sched.h>
  10#include <linux/module.h>
  11#include <linux/writeback.h>
  12#include <linux/device.h>
  13#include <trace/events/writeback.h>
  14
  15static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0);
  16
  17struct backing_dev_info default_backing_dev_info = {
  18        .name           = "default",
  19        .ra_pages       = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE,
  20        .state          = 0,
  21        .capabilities   = BDI_CAP_MAP_COPY,
  22};
  23EXPORT_SYMBOL_GPL(default_backing_dev_info);
  24
  25struct backing_dev_info noop_backing_dev_info = {
  26        .name           = "noop",
  27        .capabilities   = BDI_CAP_NO_ACCT_AND_WRITEBACK,
  28};
  29EXPORT_SYMBOL_GPL(noop_backing_dev_info);
  30
  31static struct class *bdi_class;
  32
  33/*
  34 * bdi_lock protects updates to bdi_list. bdi_list has RCU reader side
  35 * locking.
  36 */
  37DEFINE_SPINLOCK(bdi_lock);
  38LIST_HEAD(bdi_list);
  39
  40/* bdi_wq serves all asynchronous writeback tasks */
  41struct workqueue_struct *bdi_wq;
  42
  43void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2)
  44{
  45        if (wb1 < wb2) {
  46                spin_lock(&wb1->list_lock);
  47                spin_lock_nested(&wb2->list_lock, 1);
  48        } else {
  49                spin_lock(&wb2->list_lock);
  50                spin_lock_nested(&wb1->list_lock, 1);
  51        }
  52}
  53
  54#ifdef CONFIG_DEBUG_FS
  55#include <linux/debugfs.h>
  56#include <linux/seq_file.h>
  57
  58static struct dentry *bdi_debug_root;
  59
  60static void bdi_debug_init(void)
  61{
  62        bdi_debug_root = debugfs_create_dir("bdi", NULL);
  63}
  64
  65static int bdi_debug_stats_show(struct seq_file *m, void *v)
  66{
  67        struct backing_dev_info *bdi = m->private;
  68        struct bdi_writeback *wb = &bdi->wb;
  69        unsigned long background_thresh;
  70        unsigned long dirty_thresh;
  71        unsigned long bdi_thresh;
  72        unsigned long nr_dirty, nr_io, nr_more_io;
  73        struct inode *inode;
  74
  75        nr_dirty = nr_io = nr_more_io = 0;
  76        spin_lock(&wb->list_lock);
  77        list_for_each_entry(inode, &wb->b_dirty, i_wb_list)
  78                nr_dirty++;
  79        list_for_each_entry(inode, &wb->b_io, i_wb_list)
  80                nr_io++;
  81        list_for_each_entry(inode, &wb->b_more_io, i_wb_list)
  82                nr_more_io++;
  83        spin_unlock(&wb->list_lock);
  84
  85        global_dirty_limits(&background_thresh, &dirty_thresh);
  86        bdi_thresh = bdi_dirty_limit(bdi, dirty_thresh);
  87
  88#define K(x) ((x) << (PAGE_SHIFT - 10))
  89        seq_printf(m,
  90                   "BdiWriteback:       %10lu kB\n"
  91                   "BdiReclaimable:     %10lu kB\n"
  92                   "BdiDirtyThresh:     %10lu kB\n"
  93                   "DirtyThresh:        %10lu kB\n"
  94                   "BackgroundThresh:   %10lu kB\n"
  95                   "BdiDirtied:         %10lu kB\n"
  96                   "BdiWritten:         %10lu kB\n"
  97                   "BdiWriteBandwidth:  %10lu kBps\n"
  98                   "b_dirty:            %10lu\n"
  99                   "b_io:               %10lu\n"
 100                   "b_more_io:          %10lu\n"
 101                   "bdi_list:           %10u\n"
 102                   "state:              %10lx\n",
 103                   (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)),
 104                   (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)),
 105                   K(bdi_thresh),
 106                   K(dirty_thresh),
 107                   K(background_thresh),
 108                   (unsigned long) K(bdi_stat(bdi, BDI_DIRTIED)),
 109                   (unsigned long) K(bdi_stat(bdi, BDI_WRITTEN)),
 110                   (unsigned long) K(bdi->write_bandwidth),
 111                   nr_dirty,
 112                   nr_io,
 113                   nr_more_io,
 114                   !list_empty(&bdi->bdi_list), bdi->state);
 115#undef K
 116
 117        return 0;
 118}
 119
 120static int bdi_debug_stats_open(struct inode *inode, struct file *file)
 121{
 122        return single_open(file, bdi_debug_stats_show, inode->i_private);
 123}
 124
 125static const struct file_operations bdi_debug_stats_fops = {
 126        .open           = bdi_debug_stats_open,
 127        .read           = seq_read,
 128        .llseek         = seq_lseek,
 129        .release        = single_release,
 130};
 131
 132static void bdi_debug_register(struct backing_dev_info *bdi, const char *name)
 133{
 134        bdi->debug_dir = debugfs_create_dir(name, bdi_debug_root);
 135        bdi->debug_stats = debugfs_create_file("stats", 0444, bdi->debug_dir,
 136                                               bdi, &bdi_debug_stats_fops);
 137}
 138
 139static void bdi_debug_unregister(struct backing_dev_info *bdi)
 140{
 141        debugfs_remove(bdi->debug_stats);
 142        debugfs_remove(bdi->debug_dir);
 143}
 144#else
 145static inline void bdi_debug_init(void)
 146{
 147}
 148static inline void bdi_debug_register(struct backing_dev_info *bdi,
 149                                      const char *name)
 150{
 151}
 152static inline void bdi_debug_unregister(struct backing_dev_info *bdi)
 153{
 154}
 155#endif
 156
 157static ssize_t read_ahead_kb_store(struct device *dev,
 158                                  struct device_attribute *attr,
 159                                  const char *buf, size_t count)
 160{
 161        struct backing_dev_info *bdi = dev_get_drvdata(dev);
 162        unsigned long read_ahead_kb;
 163        ssize_t ret;
 164
 165        ret = kstrtoul(buf, 10, &read_ahead_kb);
 166        if (ret < 0)
 167                return ret;
linux/seq_file.h<2" name="L1622Ole.h" class="fref">linux/2f="mm/backing-dev.c#"+cod class="fref">l=et;
buf, 10, &PAGE_SHIFT - 10))
   1     unsigned long   171   1     unsigned long        unsigned long   173   1     struct   174
x) (() << ()ass="sref">PAGE_SHIFT - 10))
  175   1       17166       bdi_debug_expacking-dev.c#L15expa="L1>))))))))))))))))))))))))))))))))))))))))))))\" class="line" name="L89">  177strucct ssize_t read_code=bdi_debug_root" class=##"srefref">device *dev,
  17s="fref">             nnnnnnnnnnnn class="sref">device_attribute *attr,
)))\" class="line" name="L89">  17king-dev.       180   1             backing_dev_info *bdi = dev_get_drvdata(dev);
  181   1     n)))))))))))))))))))))))))))))))))))))))))))))))))))))\" class="line" name="L89">  18162               single_openm,
bdi_debug_ng-dev(bdi_debug_expacking-dev.c#L15expa="L1>;))\" class="line" name="L89">  183   1     84
  185   1     );
bdi_debug_i" class="sref">bdi->write_ban32" id="L132" class="line" name="L189" class="line" name="L89">  186   1     87
ssize_t read_min_ats_fe(struct (s="sref">device *dev,
88#de1fine n class="sref">device_attribute *attr,
buf, size_t count)
89   1     90   1                backing_dev_info *bdi = dev_get_drvdata(dev);
91   1                bdi_ats_fL132" class="linetid="L73" class="line" name="L73">  192   1                debugfs_reef="+code=ret" class="sref">ret;
93   1                  194   1                bdi->kstrtoul(, 10, &read_ahead_kts_fL132" class="linetid="L7L161" class="line" name="L161">95   1                "Bt < 0)
96   1                "BdiWritte>ret;
   1                  198   1                "b>->kstrtoul( 99         ."btlist_emptyode=kstrtoul" class="sref167" class="line" name="L167"2 100 2                 "b_more_io>->kstrtoul( 2                  2                 single_open 2                 (unsign2d lon20id="L144" class="line" name="L144"2 104 2                 (unsign2d lon2) ->debug_dir,
min_ats_f(struct  2                  2 106 2                 ssize_t read_max_ats_fe(struct (s="sref">device *dev,
 2                 K class="sref">device_attribute *attr,
buf, size_t count)
 2                 (unsign2d lon2)  2                 (unsign2d lon2) backing_dev_info *bdi = dev_get_drvdata(dev);
 2                 (unsign2d lon21de=dirty_thresh" class" class="sref">bdi_ats_fL132" class="linetid="L73" class="line" name="L73">  2 111 2                 debugfs_reef="+code=ret" class="sref">ret;
 2                   2 113 2                 ssize_t kstrtoul(, 10, &read_ahead_kts_fL132" class="linetid="L7L161" class="line" name="L161"2 114 2                 ! < 0)
#2ndef Ks="sref">single_open
2a href="mm/backing-dev.c2L117"2id="L117" class="line" name="L117"2 117 2      return 0;
list_ode=kstrtoul" class="sref">kstrtoul( }2list_emptyode=kstrtoul" class="sref167" class="line" name="L167"2 119
2a href="mm/backing-dev.c2L120"21n_lock" class="sref">spin_lock(&ode=kstrtoul" class="sref">kstrtoul(s2atic int   2 121{2 2      return   2 123}2->debug_dir,
max_ats_f(struct 
2a href="mm/backing-dev.c2L125"2id="L125" class="line" name="L125"2 125s2atic const struct inline void ret;
, s="sref">device *dev,
 2      .b class="sref">device_attribute *attr,
 2      .K(, 59" class="line" name="L159"2 118}2      . 2      .backing_dev_info *bdi = dev_get_drvdata(dev);
}2
  2 131
2a href="mm/backing-dev.c2L132"23de=bdi_thresh>ret;
m,
bdi_debug_ng-dev  2 122 2atic void nr_iref">spin_lock(&="+ccap_ef"ble" name_required(struct ->{2 2       2      inl class="sref">device_attribute *attrspin_lock(&="+c class=">);
>att[]="L126" class="line" name="L126"2 136 2                        2     2              spin_lock(&__ATTR_RW href="mm/backi__ATTR_RWdi->  2 127 2list___ATTR_RW href="mm/backi__ATTR_RWdi->  2 118}2a href="mm/backing-dev.c2L139"23ring">"b>->->  2 129 2atic void   2 140{2 2       2        2 143}2inline void bdi_debua hrevoid)
#2lse
s2atic bdi->kstrtoul(->{2ret < 0)
  2 147}2ret;
->}2atic linux/2f="mm/b2 149 2                        2     24a href="mm/backing-dev.9(5ss="sna hre
debug_dir);
);
>att class="sref">bdi_debug_lass=">);
>attL6"line" name="L1622Ole.h" cl2 150{2(void)
}2s2atic   2 153{2->#2#2ndif
inl" class="sref">bdi__void)
);

2a href="mm/backing-dev.c2L157"25id="L147" class="line" name="L147"2 157s2atic bdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl2 118}2                        2     25le.h" class="fref">linux/2f="mm/b2 159 2                        2     25a href="mm/backing-dev.9(5ss="snwq
bdi_alcoc_workqueutacking-dev.c#L1alcoc_workqueutdi       %10u\n"
bdi_WQ_MEM-dev.c#Lacking-dev.c#L1WQ_MEM-dev.c#L>att | ass="sref">bdi_WQ_FREEZ),
linux/2f="mm/b2 160{2bdi_WQ_UNBOUNref="mm/backing-WQ_UNBOUNr>att | ass="sref">bdi_WQ_SYSFSef="mm/backing-WQ_SYSFS="L1"sL8L6"line" name="L1622Ole.h" cl2 161 2      struct list_empty="snwq
 2      unsigned long n>retlist_emptyENOMEM
 2        2 164
2a href="mm/backing-dev.c2L165"26"sref">bdi->bdi_debuoid)
dirty_thresh< * 2      "Btlist_emptyeracking-dev.c#L15err>att146" class="line" name="L146"2 156
2      if (bdi_debuster(struct dirty_thresh< *bdi_mm/backing-dev.c#L6mm/bd="L1sr       %10u\n" 2              return list_eracking-dev.c#L15err>att class="sref">bdi_debuoid)
dirty_threshnoop_cev_info *}2linux/seq_file.h<2" name2"L1622Ole.h" class="fref">linux/2f="mm/b2cking-dev2c#"+cod class="fref">l=e2;2attL6"line" name="L1622Ole.h" cl270   2     unsigned long   271   2     unsigned long );
 2     unsigned long   273   2     struct bdi_debuhas112" ief="mm/backing-devdebuhas112" ief=s="sref">device * *bdi = 
   2     dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="L166" class="line" name="L166"27166 2       27167 2cct   27s="fref"2             /* id="L102" class="line" name="L102"27king-dev2      * This funcs_fo is used when the first  clas for this dth is marked 12" i. It id="L102" class="line" name="L102"280   2              * wakes-up the correspondnam dth L108ad which should then take care of the id="L102" class="line" name="L102"281   2      * periodic ne" -dev.c wpan>-out of 12" i  class. Since the wpan>-out would id="L102" class="line" name="L102"28162 2              * starts onlyback9;12" iewpan>
   2      * set up a timer which wakes the dth L108ad up laev_. id="L102" class="line" name="L102"284
 * id="L102" class="line" name="L102"285   2      * Note, we wouldnack9;t bother settnam up the timer, but this funcs_fo is on the id="L102" class="line" name="L102"28166 2      * fast-path (used byback9;__mark_ clas112" i()ack9;), so we savs few>bretext swL1chme="d="L102" class="line" name="L102"28167 2 href="mm/backing-dev.c#2L88" 28ss="s        %comment"> * bybdelaynam the wake-up. id="L102" class="line" name="L102"28s="fref"2fine  */ id="L102" class="line" name="L102"28king-dev2     bdi_debuwakeup_L108ad_delayed(struct device * *bdi =    2                   2                read_ahead_timeout=dev_get_drvdattimeout>attL6"line" name="L1622Ole.h" cl292   2                  293   2                ssize_t att class="sref">bdi_msecs_to_jiffi="L132" class="limsecs_to_jiffi="ev);


   2                bdi->bdi_debde=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      dworkL132" class="lidworkdibdi_timeout=dev_get_drvdattimeout>att8L6"line" name="L1622Ole.h" cl295   2                  296   2                   2                /* id="L102" class="line" name="L102"298   2                 * Ref">b dth from s="sref", and ensure that  t is no"s="ser visible id="L102" class="line" name="L102"299   2     . */ id="L102" class="line" name="L102"3 100 3                 bdi_deburef">b_fromref="+code=bdi" class="sref">b_fromref="s="sref">device * *bdi =  3                  3                 debugfs_reepin_loa rbhode=buf" class=epin_loa rbhdidirty_thresh+co_loa +code=bdi" class="sloa >att8L6"line" name="L1622Ole.h" cl3 103 3                 (unsign3d lon30ass="sref">ssize_t dirty_thresh+code=write_bandwidth" class="sref">write_bans="sref"+code=bdi" class="slef">bdi 3                bdi->dirty_thresh+co_loa +code=bdi" class="sloa >att8L6"line" name="L1622Ole.h" cl3 503 3                  3 106 3                 (&synchronef">rcu_expedan>d(struct rcu_expedan>d46" i8L6"line" name="L1622Ole.h" cl3 107 3                   3 108 3                 (unsign3d lon30ring">"b>       %comment">/* s="sref" is nowh" used,   ear  t to mark @dth dynam */ id="L102" class="line" name="L102"3 908 3     .dirty_thresh+code=write_bandwidth" class="sref">write_bans="sref"+code=bdi" class="slef">bdi 3                 (unsign3d lon31="L313" class="line" name="L53">  3 111 3                  3                 bdi_debuster(struct backing_dev_info *bdi, const char *device *dev,
 3                 ssssssssssbref">buf,  3                 !#3ndef bdi->);arg"L132" class="liarg">attL6"line" name="L1622Ole.h" cl3 116
3a href="mm/backing-dev.c3L117"31             ef">device *dev,
 3      return 0;
  3 118}3dirty_thresh+code=write_bandwidth" class="sref">write_ban/backing-dev.c#L162" id="Lt;b>       %comment">/* The driver needs to use separate queuts per sref"> */ id="L102" class="line" name="L102"3 119
3a href="mm/backing-dev.c3L120"31n_lock" class="sref">>rets3atic int   3 121{3debugfs_revasstart+code=bdi" clasvasstartdi->att1 ass="sref">bdi_fmbacking-dev.c#L1fmbclas 3      return debugfs_remoacking-dev.c#L162" id="s="sref">dev_get_drvd clacot;st_varg"L132" class="lirvd clacot;st_varg"di->bdi_pare/backing-dev.c#L1pare/bclass ass="sref">bdi_MKDEVacking-dev.c#L1MKDEVdi->bdi_fmbacking-dev.c#L1fmbclas1 ass="sref">bdi_arg"L132" class="liarg">att 3ssize_t ->att 3a href="mm/backing-dev.c3L125"32=list_empty" t < 0)
s3atic const struct Ks="sref">single_open
3      . 3      .list_+code=write_bandwidth" class="sref">write_ban/backing-dev.c#L162" id="s="sref">dev_get_drvdking-dev.c#L158" id="LL6"line" name="L1622Ole.h" cl3 118}3      .linux/2f="mm/b3 129 3      .(struct ->bdi_="srcodeking-dev.c#L158" ircodedi->}3
d(struct d>attops" class="sref">bdi_debde=write_bandwidth" class="sref">write_bants_oeking-dev.c#L158ts_oeid="LL6"line" name="L1622Ole.h" cl3 131
3a href="mm/backing-dev.c3L132"33d="L132" class="line" name="L132"3 122 3atic void debugfs_reepin_loa rbhode=buf" class=epin_loa rbhdidirty_thresh+co_loa +code=bdi" class="sloa >att8L6"line" name="L1622Ole.h" cl3 133{3ssize_t dirty_thresh+code=write_bandwidth" class="sref">write_bans="sref"+code=bdi" class="slef">bdiops" class="sref">bdi_debsref"+code=bdi" class="slef">bdi 3      bdi->dirty_thresh+co_loa +code=bdi" class="sloa >att8L6"line" name="L1622Ole.h" cl3 135 3        3 136 3                        3     3              spin_lock(&traclawpan>
(struct 
info">-> 3ret}3a href="mm/backing-dev.c3L139"33ring"3" class="line" name="L53">  3 129 3atic void ->{3  3 141 3      bdi_debuster_/backing-dev.c#L16debuster_/bainfo" class="sref">backing_dev_info *bdi, const char *bdi_="sr)
  3 122 3      }3retbdi_debuster(struct , const char *bdi_mm/backing-dev.c#L6mm/bd="L1sr       %10u\n"bdi_MAJORa href="mm/backMAJORdi->bdi_MINORa href="mm/backMINORdi->#3lse
  3 145s3atic -> 3}3/* id="L102" class="line" name="L102"3 118}3atic  * Ref">b dth from the global ref" and shutdown any L108ads we havs runnnam id="L102" class="line" name="L102"3 129 3                        3     34ch_enr       %comment"> */ id="L102" class="line" name="L102"3 150{3bdi_debuwb_shutdowncking-dev.c#L16debuwb_shutdowninfo" class="sref">backing_dev_info *bdi, const char *  3 151}3s3atic list_empty="sncap_wpan>
->  3 143}3ssssssssss>ret#3#3ndif
bdi       %comment">/* id="L102" class="line" name="L102"3 156
3a href="mm/backing-dev.c3L157"35d="L1        %comment">         * Make sure nobody finds us on the s="sref" anyma>(s=d="L102" class="line" name="L102"3 147}3atic          */ id="L102" class="line" name="L102"3 118}3                        3     35ring">"b>->b_fromref="+code=bdi" class="sref">b_fromref="s="sr>-> 3                        3     35a hre6"line" name="L1622Ole.h" cl3 160{3       %comment">/* id="L102" class="line" name="L102"3 161 3      struct          * Drain work ref" and shutdown the delayed_work.  At this po" c, id="L102" class="line" name="L102"3 152s3      unsigned long          * @dthass="s="sref" is empty Lellnam dth_Wpan>
}3               * is dynam and its worksref" needs to be drained no"matter what. id="L102" class="line" name="L102"3 164
3a href="mm/backing-dev.c3L165"36="L85r       %comment">         */ id="L102" class="line" name="L102"3 165 3      bdi->bdi_debde=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      dworkL132" class="lidworkdi
3      if ((&flush_delayed_workL132" class="liflush_delayed_workdidirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      dworkL132" class="lidworkdi}3              return list_WARN_ONL132" class="liWARN_ONdilist_empty clasempty+code=bdi" clas clasemptydidirty_thresh+code=write_bandwidth" class="sref">write_bandorksref"ref="mm/backingworksref"id="L1L6"line" name="L1622Ole.h" cl3 118}3linux/seq_file.h<2" name3"L1623Ole.h" class="fref">linux/2f="mm/b3cking-dev3c#"+cod class="fref">l=e3;3/* id="L102" class="line" name="L102"370   3     unsigned long          * This shouldnack9;t be necessary unless @dth for soms reason hae="d="L102" class="line" name="L102"371   3     unsigned long          * unflushed 12" i IO after worksref" is drained.  Do  t anyway="d="L102" class="line" name="L102"37152s3     unsigned long          * just in case. id="L102" class="line" name="L102"373   3     struct          */ id="L102" class="line" name="L102"374
bdi->dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      dworkL132" class="lidworkdi   3       37166 3      3cct /* id="L102" class="line" name="L102"37s="fref"3              * This dth is gonam away now,"make sure that no"super_bloa s po" c to it id="L102" class="line" name="L102"37king-dev3      */ id="L102" class="line" name="L102"380   3             bdi_debuprune_shref="mm/backingdebuprune_shinfo" class="sref">backing_dev_info *bdi, const char *  381   3      3             backing_super_bloa ode=buf" class=euper_bloa bdi, const char *shref="mm/backingshinfoL6"line" name="L1622Ole.h" cl383   3       384
bdi->dirty_threshsb_loa ode=buf" class=ebsloa >att8L6"line" name="L1622Ole.h" cl385   3     bdi->->bdi_super_bloa sode=buf" class=euper_bloa t>att1 ass="sref">bdi_ssref"ref="mm/backingssref"id="LL126" class="line" name="L126"38166 3     write_bant_bdi_debhref="+code=name" clasL" class="line" name="L31">  38167 3 href="mm/backing-dev.c#3L88" 38K" class="sref">K( < 0)
write_bant_bdi_< *"b3" class="line" name="L53">  38king-dev3     dirty_threshsb_loa ode=buf" class=ebsloa >att8L6"line" name="L1622Ole.h" cl390   3                  391   3                   3                bdi_debuunster(struct backing_dev_info *bdi, const char *  393   3                   3                bdidevice *dev,
bdi_debde=write_bandwidth" class="sref">write_banrvdking-dev.c#L158" id="LL6"line" name="L1622Ole.h" cl395   3                  396   3                ret < 0)
 3                Kass="sref">bdi_debufs="min_ats_f(struct , const char *   3                Kass="sref">bdi_traclawpan>
(struct 
s="sr>->   3     .spin_lock(&debuprune_shref="mm/backingdebuprune_shinfo">-> 4                   4 101 4                 spin_lock(&debuwb_shutdowncking-dev.c#L16debuwb_shutdowninfo">-> 4                spin_lock(&debue=backunster(struct -> 4                  4 403 4                bdidirty_thresh+code=write_bandwidth" class="sref">write_bandh_loa ode=buf" class=wbsloa >att8L6"line" name="L1622Ole.h" cl4 503 4                Kass="sref">bdi_debde=write_bandwidth" class="sref">write_banrvdking-dev.c#L158" id="L class="sref">bdi_mm/backing-dev.c#L6mm/bd="LL6"line" name="L1622Ole.h" cl4 603 4                bdi_epin_unloa rbhode=buf" class=epin_unloa rbhdidirty_thresh+code=write_bandwidth" class="sref">write_bandh_loa ode=buf" class=wbsloa >att8L6"line" name="L1622Ole.h" cl4 703 4                  4 108 4                 (unsign4d lon408" class="sref">Kass="sref">bdi_sref">kunster(struct kunsterinfo">-> 4     .  4 110 4                 (unsign4d lon41="L313" class="line" name="L53">  4 111 4                 ->(struct  4                   4 103 4                 inlr" class="sref">bdi_debuwb_oid)
backing_dkinwpan>
device * *bdi, const char *  4 114 4                 !#4ndef bdi->->
4a href="mm/backing-dev.c4L117"41d="L117" class="line" name="L117"4 107 4      return 0;
list_dhref="mm/backingw id="ass="sref">write_bans="href="+code=name" clas class="sref">bdi_debde=write_bandwidth" clL6"line" name="L1622Ole.h" cl4 108 4"b>->write_ban="mt_old_flush+code=bdi" clas "mt_old_flushclas class="sref">bdi_jiffi="L132" class="lijiffi="ev 4a href="mm/backing-dev.c4L120"41a href="mm/backing-dev.9(5ssINIT_LIST_HEAref="mm/backing-INIT_LIST_HEArdidirty_threshdhref="mm/backingw id="ass="sref">write_bansr
2" i(struct s4atic int dirty_threshdhref="mm/backingw id="ass="sref">write_bansr_f(struct  4debugfs_reINIT_LIST_HEAref="mm/backing-INIT_LIST_HEArdidirty_threshdhref="mm/backingw id="ass="sref">write_bansrm114" f(struct  4      return debugfs_reepin_loa roid)
dirty_threshdhref="mm/backingw id="ass="sref">write_ban clasloa ode=buf" class= clasloa di 4ssize_t dirty_threshdhref="mm/backingw id="ass="sref">write_bandworkL132" class="lidworkdibdi_ckinwpan>
 4a href="mm/backing-dev.c4L125"4245" i3" class="line" name="L53">  4 125s4atic const struct   4 116
4      ./* id="L102" class="line" name="L102"4 127 4      . * Iid)ial wpan> bandwidth: 100 MB/e="d="L102" class="line" name="L102"4 118}4      . */ id="L102" class="line" name="L102"4 129 4      . single_open}4
  4 131
4a href="mm/backing-dev.c4L132"43ove" " class="sref">bdi_debuoid)
device * *bdi, const char *  4 122 4atic void {4ss" class="sref">bdi_ href="+code=nam class=ass="sref">bdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl4 134 4       4      bdi->write_banrvdking-dev.c#L158" id="L class="sref">bdi_mm/backing-dev.c#L6mm/bd="LL6"line" name="L1622Ole.h" cl4 136 4                        4     43d="L117" class="line" name="L117"4 127 4list_+code=write_bandwidth" class="sref">write_banmin_ats_f(struct }4a href="mm/backing-dev.c4L139"43ring">"b>->write_banmax_ats_f(struct  4atic void write_banmax_prop_fracref="mm/backingmax_prop_fracd="L class="sref">bdi_FPROP_FRAC_BASEref="mm/backingFPROP_FRAC_BASEd="LL6"line" name="L1622Ole.h" cl4 140{4dirty_thresh+code=write_bandwidth" class="sref">write_bandh_loa ode=buf" class=wbsloa >att8L6"line" name="L1622Ole.h" cl4 141 4      debugfs_reINIT_LIST_HEAref="mm/backing-INIT_LIST_HEArdidirty_thresh+code=write_bandwidth" class="sref">write_bans="sref"+code=bdi" class="slef">bdi8L6"line" name="L1622Ole.h" cl4 122 4      debugfs_reINIT_LIST_HEAref="mm/backing-INIT_LIST_HEArdidirty_thresh+code=write_bandwidth" class="sref">write_bandorksref"ref="mm/backingworksref"id="LL6"line" name="L1622Ole.h" cl4 133{4  4 144#4lse
bdi->dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="/a>-> 4atic   4 136 4bdi_ href="+code=nam clas <lass="sref">bdi_mR_dev.STAT_ITEMSef="mm/backing-mR_dev.STAT_ITEMSd="LLlass="sref">bdi_ href="+code=nam clas++Lt126" class="line" name="L126"4 147}4Kass="sref">bdi_eracking-dev.c#L15err>att class="sref">bdi_percpu_coufev__oid)
dirty_thresh+code=write_bandwidth" class="sref">write_bans="sef">
" cl[ass="sref">bdi_ href="+code=nam clas]s=L8L6"line" name="L1622Ole.h" cl4 118}4atic Kt < 0)
att146" class="line" name="L146"4 129 4                        4     44n_lock" class="sref">>>>>>>>>goto=ass="sref">bdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl4 150{4  4 151}4s4atic debugfs_re+code=write_bandwidth" class="sref">write_banr2" ieexceed>d(struct dinfo clL118" class="line" name="L118"4 143}4  4 144#4bdi->write_bansw_timenef"mpde=write_bandwidw_timenef"mpclas class="sref">bdi_jiffi="L132" class="lijiffi="ev#4ndif
bdi->write_banwpantennef"mpde=write_bandwiwpantennef"mpinfo clL118" class="line" name="L118"4 136 4a href="mm/backing-dev.c4L157"45d="L117" class="line" name="L117"4 147}4atic list_+code=write_bandwidth" class="sref">write_banbalanced112" ieratelimd)
bdi_INIT_BW href="mm/backiINIT_BW" cl118" class="line" name="L118"4 118}4                        4     45ring">"b>->write_banr2" ieratelimd)
bdi_INIT_BW href="mm/backiINIT_BW" cl118" class="line" name="L118"4 129 4                        4     45a href="mm/backing-dev.9(5ss="sde=write_bandwidth" class="sref">write_banwpan>_bandwidthde=write_bandwiwpan>_bandwidthclas class="sref">bdi_INIT_BW href="mm/backiINIT_BW" cl118" class="line" name="L118"4 160{4write_banavg_wpan>_bandwidthde=write_bandwiavg_wpan>_bandwidthclas class="sref">bdi_INIT_BW href="mm/backiINIT_BW" cl118" class="line" name="L118"4 151}4      struct s4      unsigned long debugfs_reeracking-dev.c#L15err>att class="sref">bdi_fprop_loaal_oid)_percpucking-dev.c#L15fprop_loaal_oid)_percpudidirty_thresh+code=write_bandwidth" class="sref">write_bancomples_fo"L132" class="licomples_fo"s="sLL6"line" name="L1622Ole.h" cl4 143}4        4 164
4a href="mm/backing-dev.c4L165"46=list_empty" t < 0)
att1t126" class="line" name="L126"4 165 4      att:26" class="line" name="L126"4 136 4      if (->}4              return K( < 0)
dirty_thresh+code=write_bandwidth" class="sref">write_bans="sef">
" cl[ass="sref">bdi_ href="+code=nam clas]LL6"line" name="L1622Ole.h" cl4 118}4linux/seq_file.h<2" name4"L16246ring">"b3" class="line" name="L53">  4cking-dev4c#"+cod class="fref">l=e4;46a hre6"line" name="L1622Ole.h" cl470   4     unsigned long retbdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl471   4     unsigned long   47152s4     unsigned long bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi->   4     struct   474
bdi_debudestroi(struct device * *bdi, const char *  475   4      4     ret class="sref">bdi_ href="+code=nam clasL6"line" name="L1622Ole.h" cl47147}4cct   47s="fref"4             "b>       %comment">/* id="L102" class="line" name="L102"47king-dev4              * Splf"> our entri=" to the default_cev_info *   4                      * dth disappears id="L102" class="line" name="L102"481   4              */ id="L102" class="line" name="L102"48162 4             dirty_thresh+co_has112" ie_f(struct ->   4     ssssssssss class="sref">backing_dkinwpan>
bdi_< *
   4     Kass="sref">bdi_deb_loa rtwf(struct dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="/a>-> 4     ref="mm/backing classplf">info"="sref">dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      sr
2" i(struct bdi_df"ref="mm/backingds)clasass="sref">write_bansr
2" i(struct  4 href="mm/backing-dev.c#4L88" 48K" class="sref">K>->ref="mm/backing classplf">info"="sref">dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      sr_f(struct bdi_df"ref="mm/backingds)clasass="sref">write_bansr_f(struct Kass="sref">bdi_ classplf">ref="mm/backing classplf">info"="sref">dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      srm114" f(struct bdi_df"ref="mm/backingds)clasass="sref">write_bansrm114" f(struct sref">write_banepin_unloa ode=buf" class=epin_unloa didirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease       clasloa ode=buf" class= clasloa di   4                sref">write_banepin_unloa ode=buf" class=epin_unloa didirty_threshdf"ref="mm/backingds)clasass="sref">write_ban clasloa ode=buf" class= clasloa di   4                  492   4                  493   4                ssize_t (struct ->
   4                bdi       %comment">/* id="L102" class="line" name="L102"496   4                         * If ="+cunster() had al08ady been called earlier, the dworkdid="L102" class="line" name="L102"49167 4                         * coulds cill be pendiam decause debuprune_sh() c   racl with thedid="L102" class="line" name="L102"49s="fref"4                         * ckinwakeup_L108ad_delayed() c lls from __mar roief=r
2" i(). id="L102" class="line" name="L102"499   4     .         */ id="L102" class="line" name="L102"5 100 5                 dirty_thresh+code=write_bandwidth" class="sref">write_bandhref="mm/backingw id="elease      dworkL132" class="lidworkdi 5                  5                bdi_ href="+code=nam clas <lass="sref">bdi_mR_dev.STAT_ITEMSef="mm/backing-mR_dev.STAT_ITEMSd="LLlass="sref">bdi_ href="+code=nam clas++L32" class="line" name="L132"5 301 5                ssssssssss> < 0)
dirty_thresh+code=write_bandwidth" class="sref">write_bans="sef">
" cl[ass="sref">bdi_ href="+code=nam clas]LL6"line" name="L1622Ole.h" cl5 403 5                 5                bdi->dirty_thresh+code=write_bandwidth" class="sref">write_bancomples_fo"L132" class="licomples_fo"s="sLL6"line" name="L1622Ole.h" cl5 603 5                  5 703 5                bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi-> 5                linux/2f="mm/b5 908 5     ./* id="L102" class="line" name="L102"5 110 5                 (unsign5d lon51io" cr       %comment"> * For use from filesy a dth ociat>dind="L102" class="line" name="L102"5 101 5                  * with 12" i wpan>
 5                  */ id="L102" class="line" name="L102"5 103 5                 bdi_debusetup_anduster(struct device * *bdi, const char *, const char * 5                 !bdibdi_capde=write_bandwicapclasL" class="line" name="L31">  5 115#5ndef 
5a href="mm/backing-dev.c5L117"51ass="sref">ret class="sref">bdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl5 107 5      return 0;
  5 108 5"b>->write_banbdi_ 5a href="mm/backing-dev.c5L120"51a href="mm/backing-dev.9(5ss+code=write_bandwidth" class="sref">write_bancapabiliti="L132" class="licapabiliti="clas class="sref">bdi_capde=write_bandwicapclasL6"line" name="L1622Ole.h" cl5 120s5atic int att class="sref">bdi_debuoid)
 5 5      return bdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl5 103 5  5 114 5a href="mm/backing-dev.c5L125"52"sref">bdi->bdi_debuster(struct , const char *bdi_mm/backing-dev.c#L6mm/bd="L1sr       %10u\n"bdi_s5atic const struct K>ssssssssss> < 0)
retretdirty_thresh+cocseq

5      .ret < 0)
att1t126" class="line" name="L126"5 127 5      .Kass="sref">bdi_debudestroi(struct -> 5      .K>retbdi_eracking-dev.c#L15err>attL6"line" name="L1622Ole.h" cl5 908 5      .  5 130}5
  5 131
5a href="mm/backing-dev.c5L132"53ove" class="s>ret 5atic void   5 103 5bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi->di 5       5      inlsref">write_bandait_queue_h8ad_"ref="mm/backingwait_queue_h8ad_"ve" csref">write_bancongestion_wqhde=write_bandwicongestion_wqh" cl[2] cl126" class="line" name="L126"5 136 5                        5     53             -> 5Kass="sref">bdi___WAIT_QUEUE_HEAr_INITIALIZERde=write_bandwi__WAIT_QUEUE_HEAr_INITIALIZERdi->}5a href="mm/backing-dev.c5L139"53ring">"b}L6"line" name="L1622Ole.h" cl5 908 5atic void inlsref">write_banatomic_"ref="mm/backingatomic_"ve" csref">write_bannrrdebucongest>d(struct d" cl[2]L6"line" name="L1622Ole.h" cl5 140{5  5 141 5      bdi_clearrdebucongest>d(struct ddidevice * *bdi, const char *bdi_eyncref="mm/backingeyncdi 5      {5ssenumlass="sref">bdi_debusf">hhref="+code=namdebusf">hve" csref">write_banbd)
 5lse
bdi->, const char *wqhde=write_bandwiwqh" cl cls" class="sref">bdi_congestion_wqhde=write_bandwicongestion_wqh" cl[ass="sref">bdi_eyncref="mm/backingeyncdi 5atic   5 136 5bdi_eyncref="mm/backingeyncdibdi_dev.eyncucongest>d(struct ddibdi_dev.aeyncucongest>d(struct ddi 5->bdi_debde=write_bandwidth" class="sref">write_bansf">hhref="+code=namsf">hve" L102" class="line" name="L102"5 118}5atic Ksref">write_banatomic_decref="mm/backingatomic_decdidirty_threshnrrdebucongest>d(struct d" cl[ass="sref">bdi_eyncref="mm/backingeyncdi 5                        5     54a href="mm/backing-dev.9(5sssmp_mb__afteruclearrdd)
{5 < 0)
}5spin_lock(&wake_upde=write_bandwiwake_updi-> 5atic   5 143}5bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi-> 5#5ndif
bdi_fs="debucongest>d(struct device * *bdi, const char *bdi_eyncref="mm/backingeyncdi 5a href="mm/backing-dev.c5L157"55d="L1126" class="line" name="L126"5 147}5atic bdi_debusf">hhref="+code=namdebusf">hve" csref">write_banbd)
}5                        5     55le.h" class="fref">linux/2f="mm/b5 129 5                        5     55a href="mm/backing-dev.9(5ss=d)
bdi_eyncref="mm/backingeyncdibdi_dev.eyncucongest>d(struct ddibdi_dev.aeyncucongest>d(struct ddi{5 < 0)
bdi_debde=write_bandwidth" class="sref">write_bansf">hhref="+code=namsf">hve" L102" class="line" name="L102"5 151}5      struct spin_lock(&atomic_incref="mm/backingatomic_incdidirty_threshnrrdebucongest>d(struct d" cl[ass="sref">bdi_eyncref="mm/backingeyncdis5      unsigned long   5 143}5      bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi->d(struct  5a href="mm/backing-dev.c5L165"56d="L125" class="line" name="L125"5 165 5      /** id="L102" class="line" name="L102"5 136 5      if ( * congestion_wait - wait for a i" class="s to become uncongest>ddid="L102" class="line" name="L102"5 147}5              return  * @eync: SYNC or ASYNC IOdid="L102" class="line" name="L102"5 118}5linux/seq_file.h<2" name5"L16256dirtyr       %comment"> * @timeout: timeout t  jiffi="evd="L102" class="line" name="L102"5 129 5c#"+cod class="fref">l=e5;56ch_enr       %comment"> * id="L102" class="line" name="L102"570   5     unsigned long  * Waits for up to @timeout jiffi=" for a i" class="s (any i" class="s) to exd)did="L102" class="line" name="L102"57151}5     unsigned long  * wpan> congestion.  If no i" class="ss ar> congested the  just wait for thedid="L102" class="line" name="L102"57152s5     unsigned long  * next wpan> to be complesed. id="L102" class="line" name="L102"573   5     struct  */ id="L102" class="line" name="L102"574
write_bancongestion_wad)
bdi_eyncref="mm/backingeyncdiwrite_bantimeout
   5      5     reloascsref">write_banracking-dev.c#L16"re)di}5cct write_bansf"r)
bdi_jiffi="L132" class="lijiffi="ev"b>->, const char *wqhde=write_bandwiwqh" cl cls" class="sref">bdi_congestion_wqhde=write_bandwicongestion_wqh" cl[ass="sref">bdi_eyncref="mm/backingeyncdi   5               581   5     debugfs_reprepar>_to_wad)
bdi_wad)
bdi_TASK_UNINTERRUPTIBLE
 5             write_banracking-dev.c#L16"re)dibdi_io_schedule_timeout
   5     ssize_t bdi_wad)

   5     bdi->
->-> 5     ->single_open 5 href="mm/backing-dev.c#5L88" 58="L88" class="line" name="L88">  58s="fref"5fine bdi_racking-dev.c#L16"re)di  590   5                bdi_EXPORT_SYMBObacking-dev.c#L6EXPORT_SYMBObdi->   5                   5                /** id="L102" class="line" name="L102"593   5                 * wait_iffucongest>d -fConditionally wait for a i" class="s to become uncongest>d or a zon> to complese wpan>"evd="L102" class="line" name="L102"594
 * @zon>: A zon> to checkatddid="L102" class="line" name="L102"595   5                 * @eync: SYNC or ASYNC IOdid="L102" class="line" name="L102"596   5                 * @timeout: timeout t  jiffi="evd="L102" class="line" name="L102"59167 5                 * id="L102" class="line" name="L102"59s="fref"5                 * Ii the event of a congest>d i" class="s (any i" class="s) and the given id="L102" class="line" name="L102"59king-dev5     . * @zon> has experiencede>rcent congestion,/this waits for up to @timeout id="L102" class="line" name="L102"6 100 6                  * jiffi=" for either a BDI to exd) congestion of the given @eync queue id="L102" class="line" name="L102"6 100 6                 * or a wpan> to complese. id="L102" class="line" name="L102"6 201 6                 * id="L102" class="line" name="L102"6 301 6                 * Ii the absence of zon> congestion,/condustsched() is called to yielddid="L102" class="line" name="L102"6 403 6                 * the processor t 6                 * id="L102" class="line" name="L102"6 603 6                 * The >ret 6                 * it is the number of jiffi=" that weres cill remaining whe  the function id="L102" class="line" name="L102"6 803 6                 * >retret 6     . */ id="L102" class="line" name="L102"6 110 6                 (unsign6d lon61io" cloascsref">write_banwait_iffucongest>dref="mm/backingwait_iffucongest>ddidevice *ref="mm/backingzon>ve" ca>, const char *zon>ref="mm/backingzon>ve" , t class="sref">bdi_eyncref="mm/backingeyncdiwrite_bantimeout
 6                  6                 write_banracking-dev.c#L16"re)di 6                 ssunsigned loascsref">write_bansf"r)
bdi_jiffi="L132" class="lijiffi="ev 6                 !bdi->#6ndef bdi->, const char *wqhde=write_bandwiwqh" cl cls" class="sref">bdi_congestion_wqhde=write_bandwicongestion_wqh" cl[ass="sref">bdi_eyncref="mm/backingeyncdi
6a href="mm/backing-dev.c6L117"61d="L117" class="line" name="L117"6 107 6      return 0;
/* id="L102" class="line" name="L102"6 108 6         * I 6a href="mm/backing-dev.c6L120"61ch_enr       %comment">         * encoufev_ed "  the current zon>, yield taddid="L102" class="line" name="L102"6 120s6atic int          * of sleeping o  the congestion queue id="L102" class="line" name="L102"6 111 6         */ id="L102" class="line" name="L102"6 112 6      return addidirty_threshnrrdebucongest>d(struct d" cl[ass="sref">bdi_eyncref="mm/backingeyncdi 6ssssssssssssssssss!> < 0)
_is_r>refimucongest>d(struct _is_r>refimucongest>ddi->ve" L1t126" class="line" name="L126"6 114 6a href="mm/backing-dev.c6L125"62"sref">bdibdi->s6atic const struct   6 116
6      .       %comment">/* Ii case wes cheduled, work out time remaining */ id="L102" class="line" name="L102"6 107 6      .Kass="sref">bdi_racking-dev.c#L16"re)dibdi_timeout
single_open 6      .Kt < 0)
 6      .Kass="sref">bdi_racking-dev.c#L16"re)di}6
  6 131
6a href="mm/backing-dev.c6L132"631_lock" class="sref">goto=ass="sref">bdi_out
 6atic void   6 103 6  6 134 6      /* Sleep ufeil uncongest>d or a wpan> happens */ id="L102" class="line" name="L102"6 135 6      bdi->_to_wad)di->bdi_wad)
bdi_TASK_UNINTERRUPTIBLE
 6                        6     63             spin_lock(&racking-dev.c#L16"re)dibdi_io_schedule_timeout
 6list_finish_wad)
bdi_wad)
}6a href="mm/backing-dev.c6L139"63le.h" class="fref">linux/2f="mm/b6 908 6atic void bdi_out
{6
dref="mm/backingtraclnwpan>
ddi->-> 6      f="mm/baass="sref">Kass="sref">bdi_jiffi="_to_usec"L132" class="lijiffi="_to_usec"di->single_open 6        6 133{6ss>retbdi_racking-dev.c#L16"re)di 6lse
  6 135 6atic ->ddi 6 6bdi_pdflush_proc_obsolese
device *, const char *table
bdi_wpan>ref="mm/backingwpan>ve" ,17" class="line" name="L117"6 118}6atic K>>>>>>>>r" class="sref">bdi___use>(struct ve" ca>, const char *buffa>(struct dibdi_size_"ref="mm/backingsize_"ve" ca>, const char *lenpde=write_bandwilenpdibdi_loffu"ref="mm/backingloffu"ve" ca>, const char *ppo"L132" class="lippo"di 6                        6     64a hre126" class="line" name="L126"6 150{6, const char *k=ufL132" class="lik=uf" cl[] clr       %10u\n"}6 6atic }6ssssssssssa>, const char *lenpde=write_bandwilenpdi 6bdibdiret#6ndif
bdi  6 136 6a href="mm/backing-dev.c6L157"65d="L117" class="line" name="L117"6 147}6atic (struct dibdi_k=ufL132" class="lik=uf" cl, sizeofa>->}6                        6     658" class="sref">K>ret 6                        6     65a href="mm/backing-dev.9(5sspu\ntk_on">ref="mm/backingpu\ntk_on">di->{6f="mm/backing-dev.9(5sstable
write_banprocng-dref="mm/backingpuocng-ddi}6      struct s6      unsigned long }6      , const char *lenpde=write_bandwilenpdi 6a href="mm/backing-dev.c6L165"66"sref">bdiret#6        6 136 6      if ((>LXR communi iinfoopthis experimental version by  class="liailto:lx>@a hux.nowilx>@a hux.noinfo.
 /div>
(> lx>.a hux.no amedly host>d iy class="lhttp://www.redpill-a hpro.nowiRedpill L hpro ASinfoopprovider of L hux consulting and operas_fo" se>vice" since 1995. /div>