Re: [PATCH 10/11] maps3: add /proc/kpagecount and /proc/kpageflags interfaces

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dave Hansen
Date: Monday, October 15, 2007 - 4:34 pm

On Mon, 2007-10-15 at 18:11 -0500, Matt Mackall wrote:

This is true, but it forces a lot of logic from the kernel to be run in
userspace to figure out what is going on.  Looking at mainline today:

#define PG_reclaim              17      /* To be reclaimed asap */
...
#define PG_readahead            PG_reclaim /* Reminder to do async read-ahead */

All of a sudden, to figure out which flag it actually is, we need to
have all of the logic that the kernel does.  

Does this establish a fixed user<->kernel ABI that will keep us from
doing this in the future:

-#define PG_slab                  7      /* slab debug (Suparna wants this) */
+#define PG_slab                  14      /* slab debug (Suparna wants this) */

Or, even something like this:

-#define PageSlab(page)          test_bit(PG_slab, &(page)->flags)
+#define PageSlab(page)          (!PageLRU(page) && !PageHighmem(page))

If we actually had several (or even still one file) that exposed this
state, independent of the actual content of page->flags, I think we'd be
better off.  I think that's the difference between a fun, super-useful
debugging feature and one that can stay in mainline and have
applications stay using it (without breaking) for a long time.

The flags you listed are things that I would imagine will always exist,
logically.  But, we might not always have a specific page flag for pages
under writeback or in the buddy list for that matter.  PG_buddy isn't
that old.  Perhaps that would be better abstracted to something like
page_in_main_allocator().

-- Dave

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/11] maps3: pagemap monitoring v3, Matt Mackall, (Mon Oct 15, 3:25 pm)
[PATCH 3/11] maps3: move is_swap_pte, Matt Mackall, (Mon Oct 15, 3:26 pm)
[PATCH 4/11] maps3: introduce a generic page walker, Matt Mackall, (Mon Oct 15, 3:26 pm)
[PATCH 7/11] maps3: move clear_refs code to task_mmu.c, Matt Mackall, (Mon Oct 15, 3:26 pm)
[PATCH 8/11] maps3: regroup task_mmu by interface, Matt Mackall, (Mon Oct 15, 3:26 pm)
[PATCH 9/11] maps3: add /proc/pid/pagemap interface, Matt Mackall, (Mon Oct 15, 3:26 pm)
Re: [PATCH 4/11] maps3: introduce a generic page walker, Jeremy Fitzhardinge, (Mon Oct 15, 3:40 pm)
Re: [PATCH 11/11] maps3: make page monitoring /proc file o ..., Jeremy Fitzhardinge, (Mon Oct 15, 3:51 pm)
Re: [PATCH 4/11] maps3: introduce a generic page walker, Jeremy Fitzhardinge, (Mon Oct 15, 4:20 pm)
Re: [PATCH 4/11] maps3: introduce a generic page walker, Matt Mackall, (Mon Oct 15, 4:30 pm)
Re: [PATCH 10/11] maps3: add /proc/kpagecount and /proc/kp ..., Dave Hansen, (Mon Oct 15, 4:34 pm)
Re: [PATCH 4/11] maps3: introduce a generic page walker, David Rientjes, (Mon Oct 15, 9:58 pm)
Re: [PATCH 7/11] maps3: move clear_refs code to task_mmu.c, David Rientjes, (Mon Oct 15, 10:11 pm)