[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0802121702431.11628@schroedinger.engr.sgi.com>
Date: Tue, 12 Feb 2008 17:04:24 -0800 (PST)
From: Christoph Lameter <clameter@....com>
To: Paul Jackson <pj@....com>
cc: Lee Schermerhorn <Lee.Schermerhorn@...com>, rientjes@...gle.com,
akpm@...ux-foundation.org, ak@...e.de, linux-kernel@...r.kernel.org
Subject: Re: [patch 1/4] mempolicy: convert MPOL constants to enum
On Tue, 12 Feb 2008, Paul Jackson wrote:
> I'm inclined toward the original types for the 'policy' field.
Good. And remove the enum.
> Specifically, I'd suggest adding the one line for 'mode_f_static_nodes'
> as below, and leaving the code involving the encoding of the policy
> field alone.
>
> struct mempolicy {
> atomic_t refcnt;
> short policy; /* See MPOL_* above */
> int mode_f_static_nodes:1; /* <== Added line <== */
It would be better to add some sort of flags field?
> Single bit fields (The ":1" above) provide the simplest way to add
> boolean flags to structs. Let the compiler do the work of packing
> and unpacking the field.
We usually do that with unsigned XXX and constants. You may want to check
multiple flags at once or do other fancy things.
--
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