mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <balbir@in.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] memcg: shmem_getpage release page sooner
Date: Sun, 29 Jun 2008 01:14:30 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0806290113350.20280@blonde.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0806290108110.20280@blonde.site>

No big deal, but since mem_cgroup_shrink_usage doesn't require a page to
operate upon, page_cache_release the swappage before calling it, so it's
not pinned across the reclaim.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Should follow mmotm's memcg-helper-function-for-relcaim-from-shmem.patch

 mm/shmem.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- mmotm/mm/shmem.c	2008-06-27 13:39:20.000000000 +0100
+++ linux/mm/shmem.c	2008-06-27 17:25:41.000000000 +0100
@@ -1315,16 +1315,14 @@ repeat:
 			shmem_swp_unmap(entry);
 			spin_unlock(&info->lock);
 			unlock_page(swappage);
+			page_cache_release(swappage);
 			if (error == -ENOMEM) {
 				/* allow reclaim from this memory cgroup */
 				error = mem_cgroup_shrink_usage(current->mm,
-					gfp & ~__GFP_HIGHMEM);
-				if (error) {
-					page_cache_release(swappage);
+								gfp);
+				if (error)
 					goto failed;
-				}
 			}
-			page_cache_release(swappage);
 			goto repeat;
 		}
 	} else if (sgp == SGP_READ && !filepage) {

  reply	other threads:[~2008-06-29  0:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-29  0:13 [PATCH] memcg: fix shmem_unuse_inode charging Hugh Dickins
2008-06-29  0:14 ` Hugh Dickins [this message]
2008-06-30  2:28   ` [PATCH] memcg: shmem_getpage release page sooner KAMEZAWA Hiroyuki
2008-06-29  0:15 ` [PATCH] memcg: mem_cgroup_shrink_usage css_put Hugh Dickins
2008-06-30  2:27   ` KAMEZAWA Hiroyuki
2008-06-30  6:28     ` Balbir Singh
2008-06-29  0:17 ` [PATCH] memcg: further checking of disabled flag Hugh Dickins
2008-06-30  2:26   ` KAMEZAWA Hiroyuki
2008-06-30  6:27     ` Balbir Singh
2008-06-30  6:05   ` Li Zefan
2008-06-30  2:23 ` [PATCH] memcg: fix shmem_unuse_inode charging KAMEZAWA Hiroyuki
2008-06-30  6:26   ` Balbir Singh

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=Pine.LNX.4.64.0806290113350.20280@blonde.site \
    --to=hugh@veritas.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@in.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --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

all inboxes | Powered by JetHome®