lkml.org 
[lkml]   [2009]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: meminfo Committed_AS underflows
    * KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2009-04-15 13:10:06]:

    > > * KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2009-04-15 11:04:59]:
    > >
    > > > committed = atomic_long_read(&vm_committed_space);
    > > > + if (committed < 0)
    > > > + committed = 0;
    > >
    > > Isn't this like pushing the problem under the rug?
    >
    > global_page_state() already has same logic.
    > IOW almost meminfo filed has this one (except Commited_AS).
    >

    OK

    >
    > > > allowed = ((totalram_pages - hugetlb_total_pages())
    > > > * sysctl_overcommit_ratio / 100) + total_swap_pages;
    > > >
    > > > Index: b/mm/swap.c
    > > > ===================================================================
    > > > --- a/mm/swap.c
    > > > +++ b/mm/swap.c
    > > > @@ -519,7 +519,7 @@ EXPORT_SYMBOL(pagevec_lookup_tag);
    > > > * We tolerate a little inaccuracy to avoid ping-ponging the counter between
    > > > * CPUs
    > > > */
    > > > -#define ACCT_THRESHOLD max(16, NR_CPUS * 2)
    > > > +#define ACCT_THRESHOLD max_t(long, 16, num_online_cpus() * 2)
    > > >
    > >
    > > Hmm.. this is a one time expansion, free of CPU hotplug.
    > >
    > > Should we use nr_cpu_ids or num_possible_cpus()?
    >
    > #define num_online_cpus() cpumask_weight(cpu_online_mask)
    > #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
    >
    > num_possible_cpus() have the same calculation cost.
    > nr_cpu_ids isn't proper value.
    > it point to valid cpu-id range, no related number of online nor possible cpus.
    >

    Since the value is just a basis for thresholds, num_online_cpus()
    might work.

    --
    Balbir


    \
     
     \ /
      Last update: 2009-04-15 10:51    [W:0.021 / U:2.408 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site