Re: [PATCH] mm counter operations through macros

From: Christoph Lameter (clameter_at_sgi.com)
Date: 03/12/05

  • Next message: Adam Belay: "Re: [2.6 patch] drivers/pnp/: possible cleanups"
    Date:	Fri, 11 Mar 2005 16:35:19 -0800 (PST)
    To: Andrew Morton <akpm@osdl.org>
    
    

    On Fri, 11 Mar 2005, Andrew Morton wrote:

    > > +#define set_mm_counter(mm, member, value) (mm)->member = (value)
    > > +#define get_mm_counter(mm, member) ((mm)->member)
    > > +#define update_mm_counter(mm, member, value) (mm)->member += (value)
    > > +#define inc_mm_counter(mm, member) (mm)->member++
    > > +#define dec_mm_counter(mm, member) (mm)->member--
    > > +#define MM_COUNTER_T unsigned long
    >
    > Would prefer `mm_counter_t' here.
    >
    > Why not a typedef?

    Ok typedef it is.

    > > @@ -231,9 +237,13 @@ struct mm_struct {
    > > unsigned long start_code, end_code, start_data, end_data;
    > > unsigned long start_brk, brk, start_stack;
    > > unsigned long arg_start, arg_end, env_start, env_end;
    > > - unsigned long rss, anon_rss, total_vm, locked_vm, shared_vm;
    > > + unsigned long total_vm, locked_vm, shared_vm;
    > > unsigned long exec_vm, stack_vm, reserved_vm, def_flags, nr_ptes;
    > >
    > > + /* Special counters protected by the page_table_lock */
    > > + MM_COUNTER_T rss;
    > > + MM_COUNTER_T anon_rss;
    > > +
    >
    > Why were only two counters converted?

    Because only these two counters are protected by the page table lock.

    > Could I suggest that you rename all these counters, so that code which
    > fails to use the macros won't compile?

    Ok. will make them mm_xx as they were in previous patches.

    -
    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/


  • Next message: Adam Belay: "Re: [2.6 patch] drivers/pnp/: possible cleanups"

    Relevant Pages

    • Re: [RFC] Splitting out kernel<=>userspace ABI headers
      ... >> I assume you are worried about the stuff under asm that ends up ... because the userspace program may have already made its ... uint32_t to anything different than 'typedef ' ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] fs/fcntl.c : dont test unsigned value for less than zero
      ... > I think Linux only complained if we're using some typedef that actually ... For fcntl that 'arg' argument is unsigned and that's hardcoded ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH 8/9] mm: fix rss and mmlist locking
      ... * The mm counters are not protected by its page_table_lock, ... +typedef atomic64_t mm_counter_t; ... struct rb_root mm_rb; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] Real-Time Preemption, -RT-2.6.11-rc3-V0.7.38-01
      ... #ifndef RAW_SPIN_LOCK_UNLOCKED ... typedef raw_spinlock_t spinlock_t ... 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/ ...
      (Linux-Kernel)
    • Re: [RFC] Splitting out kernel<=>userspace ABI headers
      ... > POSIX types instead of defining our own? ... Since struct stat in that case uses fixed-bit-size types, ... typedef __kabi_u8 u_int8; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)