linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [RFC] CMA: clear buffer-head lru before page migration
@ 2014-07-04  8:25 Gioh Kim
  2014-07-07 22:52 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Gioh Kim @ 2014-07-04  8:25 UTC (permalink / raw)
  To: Andrew Morton, Laura Abbott, Michal Nazarewicz, Marek Szyprowski,
	Joonsoo Kim, Alexander Viro, linux-fsdevel, linux-kernel
  Cc: 이건호, Gi-Oh Kim


Hi,

For page migration of CMA, buffer-heads of lru should be dropped.
Please refer to https://lkml.org/lkml/2014/6/23/932 for the detail.

I'm attaching a patch to drop all buffer-head on lru with invalidate_bh_lrus.
Please look into this. Thanks

------------------------------ 8< ---------------------------------
>From d90cd3d13b73f7278c60d8fe625840664adcbb6a Mon Sep 17 00:00:00 2001
From: Gioh Kim <gioh.kim@lge.com>
Date: Fri, 4 Jul 2014 16:53:22 +0900
Subject: [PATCH] [RFC] CMA: clear buffer-head lru before page migration

When CMA try to migrate page, some buffer-heads can exist on lru.
The bh on lru has non-zero count value so that it cannot be dropped
even-if it is not used. We can drop only buffers related to the
migrated page, but it can take long time more than dropping all
because of searching list. There all buffers in lru are dropped.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
Signed-off-by: Gioh Kim <gioh.kim@lge.com>
---
 fs/buffer.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/fs/buffer.c b/fs/buffer.c
index eba6e4f..4f11b7a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3233,6 +3233,19 @@ int try_to_free_buffers(struct page *page)
        if (PageWriteback(page))
                return 0;

+#ifdef CONFIG_CMA
+       /*
+        * When CMA try to migrate page, some buffer-heads can exist on lru.
+        * The bh on lru has non-zero count value so that it cannot
+        * be dropped even-if it is not used.
+        * We can drop only buffers related to the migrated page,
+        * but it can take long time more than dropping all
+        * because of searching list.
+        * There all buffers in lru are dropped first.
+        */
+       invalidate_bh_lrus();
+#endif
+
        if (mapping == NULL) {          /* can this still happen? */
                ret = drop_buffers(page, &buffers_to_free);
                goto out;
--
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-15  6:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04  8:25 [PATCH] [RFC] CMA: clear buffer-head lru before page migration Gioh Kim
2014-07-07 22:52 ` Andrew Morton
2014-07-08  4:44   ` Gioh Kim
2014-07-08  4:48     ` Andrew Morton
2014-07-08 16:46   ` Michal Nazarewicz
2014-07-14  7:02     ` Joonsoo Kim
2014-07-14 15:25       ` Michal Nazarewicz
2014-07-14 20:37       ` Andrew Morton
2014-07-15  6:25         ` Gioh Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).