public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [oom]: [1/4] add __GFP_WIRED to pinned allocations
Date: Wed, 23 Jun 2004 15:22:21 -0700	[thread overview]
Message-ID: <20040623222221.GE1552@holomorphy.com> (raw)
In-Reply-To: <20040623150546.4f66f941.akpm@osdl.org>

William Lee Irwin III <wli@holomorphy.com> wrote:
>> +#define __GFP_WIRED	0x8000	/* pinned */

On Wed, Jun 23, 2004 at 03:05:46PM -0700, Andrew Morton wrote:
> This would be a nice thing to keep track of.
> Isn't it the case that reclaimable slab pages (dentry, inode, mbcache,
> dquot) should not be accounted as wired memory?  Could perhaps use
> SLAB_RECLAIM_ACCOUNT for that.
> It would need to be overridden for, say, sysfs inodes and dentries, but
> they're about to become reclaimable anyway so no prob.
> It would need to be overridden for, say, ramfs dentries and inodes though.
> rd.c's blockdev pagecache pages are wired.

It's difficult to come up with comprehensible semantic refinements.
The trick with slab is whole slabs are frequently pinned by active
references, so there's quite a bit of squishiness there even after
SLAB_RECLAIM_ACCOUNT is figured out. A counter in the slab header for
references is plausibly precise, but appears to too invasive to ever
put into place. A less invasive refinement may be to clear_page_wired()
for empty slab pages.

Thanks for spotting rd.c's blkdev pagecache; that's a bogon in my
patches.

Also, I should mention this concept is based on code seen in RHEL3,
which uses a __GFP_WIRED flag, albeit for a different purpose (it
appears to be centered around removing dirty ramfs pagecache from
the LRU lists(s) as opposed to accounting for OOM-related reasons).


-- wli

Index: linux-2.6.7/drivers/block/rd.c
===================================================================
--- linux-2.6.7.orig/drivers/block/rd.c	2004-06-16 05:19:37.000000000 +0000
+++ linux-2.6.7/drivers/block/rd.c	2004-06-23 22:16:45.000000000 +0000
@@ -378,7 +378,7 @@
 		 */
 		gfp_mask = mapping_gfp_mask(mapping);
 		gfp_mask &= ~(__GFP_FS|__GFP_IO);
-		gfp_mask |= __GFP_HIGH;
+		gfp_mask |= __GFP_HIGH|__GFP_WIRED;
 		mapping_set_gfp_mask(mapping, gfp_mask);
 	}
 

  reply	other threads:[~2004-06-23 22:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23 21:07 [oom]: [0/4] fix OOM deadlock running OAST William Lee Irwin III
2004-06-23 21:07 ` [oom]: [1/4] add __GFP_WIRED to pinned allocations William Lee Irwin III
2004-06-23 21:07   ` [oom]: [2/4] add nr_wired to page_state William Lee Irwin III
2004-06-23 21:07     ` [oom]: [3/4] track wired pages on a per-zone basis William Lee Irwin III
2004-06-23 21:07       ` [oom]: [4/4] check __GFP_WIRED in out_of_memory() William Lee Irwin III
2004-06-23 21:29       ` [oom]: [3/4] track wired pages on a per-zone basis William Lee Irwin III
2004-06-23 22:15       ` Andrew Morton
2004-06-23 22:28         ` William Lee Irwin III
2004-06-23 22:05   ` [oom]: [1/4] add __GFP_WIRED to pinned allocations Andrew Morton
2004-06-23 22:22     ` William Lee Irwin III [this message]
2004-06-23 22:36       ` Andrew Morton
2004-06-23 22:16 ` [oom]: [0/4] fix OOM deadlock running OAST Andrew Morton
2004-06-23 22:31   ` William Lee Irwin III
2004-06-23 22:37     ` Andrew Morton
2004-06-23 23:07       ` William Lee Irwin III
2004-06-23 23:38         ` Andrew Morton
2004-06-24  0:03           ` William Lee Irwin III
2004-06-24  0:18             ` Andrew Morton
2004-06-24  0:26               ` William Lee Irwin III
2004-06-24  0:32                 ` William Lee Irwin III
2004-06-24  1:07                   ` Andrew Morton
2004-06-24  1:24                     ` William Lee Irwin III
2004-06-24  1:52                       ` William Lee Irwin III
2004-06-24  2:01                         ` Andrew Morton
2004-06-24  2:15                           ` William Lee Irwin III
2004-06-24 14:16                 ` Marcelo Tosatti
2004-06-24 15:18                   ` William Lee Irwin III
2004-06-24 15:19                     ` William Lee Irwin III
2004-06-24 15:23                   ` William Lee Irwin III
2004-06-24 16:55                     ` Marcelo Tosatti
2004-06-25 15:18         ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040623222221.GE1552@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox