lkml.org 
[lkml]   [2007]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-16 04:27    [W:1.538 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site