[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.0.9999.0710151917060.11508@chino.kir.corp.google.com>
Date: Mon, 15 Oct 2007 19:24:09 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Matt Mackall <mpm@...enic.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Dave Hansen <haveblue@...ibm.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Jeremy Fitzhardinge <jeremy@...p.org>,
Fengguang Wu <wfg@...l.ustc.edu.cn>
Subject: Re: [PATCH 1/11] maps3: add proportional set size accounting in
smaps
On Mon, 15 Oct 2007, Matt Mackall wrote:
> > The pss is going to need accessor functions, preferably inlined, and the
> > comment adjusted stating that all accesses should be through those
> > functions and not directly to the mem_size_stats struct.
> >
> > static inline u64 pss_up(unsigned long pss)
> > {
> > return pss << PSS_DIV_BITS;
> > }
> >
> > static inline unsigned long pss_down(u64 pss)
> > {
> > return pss >> PSS_DIV_BITS;
> > }
>
> I think that's overkill for something that has exactly one use of each.
>
There's no overkill at all, the current uses are already accessed with
these bitshifts so there's no overhead when using an inlined function
instead.
To correctly access the pss, these bitshifts are required because the
decision was made to use the lower PSS_DIV_BITS for rounding. Thus, you
need to include accessor functions so that they are always accessed
correctly now and in the future.
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists