linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmscan: remove obsolete comment of shrinker
@ 2012-06-29  4:51 Minchan Kim
  2012-06-29 13:15 ` Cong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Minchan Kim @ 2012-06-29  4:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-mm, Minchan Kim, Al Viro, Mikulas Patocka,
	Konstantin Khlebnikov

09f363c7 fixed shrinker callback returns -1 when nr_to_scan is zero
for preventing excessive the slab scanning. But 635697c6 fixed the
problem, again so we can freely return -1 although nr_to_scan is zero.
So let's revert 09f363c7 because the comment added in 09f363c7 made a
unnecessary rule shrinker user should be aware of.

Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 fs/super.c               |    2 +-
 include/linux/shrinker.h |    1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index c2f3a1f..1c2868c 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -62,7 +62,7 @@ static int prune_super(struct shrinker *shrink, struct shrink_control *sc)
 		return -1;
 
 	if (!grab_super_passive(sb))
-		return !sc->nr_to_scan ? 0 : -1;
+		return -1;
 
 	if (sb->s_op && sb->s_op->nr_cached_objects)
 		fs_objects = sb->s_op->nr_cached_objects(sb);
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index 07ceb97..ac6b8ee 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -20,7 +20,6 @@ struct shrink_control {
  * 'nr_to_scan' entries and attempt to free them up.  It should return
  * the number of objects which remain in the cache.  If it returns -1, it means
  * it cannot do any scanning at this time (eg. there is a risk of deadlock).
- * The callback must not return -1 if nr_to_scan is zero.
  *
  * The 'gfpmask' refers to the allocation we are currently trying to
  * fulfil.
-- 
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: remove obsolete comment of shrinker
  2012-06-29  4:51 [PATCH] vmscan: remove obsolete comment of shrinker Minchan Kim
@ 2012-06-29 13:15 ` Cong Wang
  2012-06-29 22:32   ` Minchan Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2012-06-29 13:15 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel


On Fri, 29 Jun 2012 at 04:51 GMT, Minchan Kim <minchan@kernel.org> wrote:
> 09f363c7 fixed shrinker callback returns -1 when nr_to_scan is zero
> for preventing excessive the slab scanning. But 635697c6 fixed the
> problem, again so we can freely return -1 although nr_to_scan is zero.
> So let's revert 09f363c7 because the comment added in 09f363c7 made a
> unnecessary rule shrinker user should be aware of.
>

Please also include the subject of the commit, not just raw hash number. ;)

For example,

09f363c7("vmscan: fix shrinker callback bug in fs/super.c")
635697c6("vmscan: fix initial shrinker size handling")

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmscan: remove obsolete comment of shrinker
  2012-06-29 13:15 ` Cong Wang
@ 2012-06-29 22:32   ` Minchan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2012-06-29 22:32 UTC (permalink / raw)
  To: Cong Wang; +Cc: linux-mm, linux-kernel

On Fri, Jun 29, 2012 at 01:15:43PM +0000, Cong Wang wrote:
> 
> On Fri, 29 Jun 2012 at 04:51 GMT, Minchan Kim <minchan@kernel.org> wrote:
> > 09f363c7 fixed shrinker callback returns -1 when nr_to_scan is zero
> > for preventing excessive the slab scanning. But 635697c6 fixed the
> > problem, again so we can freely return -1 although nr_to_scan is zero.
> > So let's revert 09f363c7 because the comment added in 09f363c7 made a
> > unnecessary rule shrinker user should be aware of.
> >
> 
> Please also include the subject of the commit, not just raw hash number. ;)
> 
> For example,
> 
> 09f363c7("vmscan: fix shrinker callback bug in fs/super.c")
> 635697c6("vmscan: fix initial shrinker size handling")

Yeb. It seems akpm handled it by himself.
But I will keep in mind.

Thanks, Cong!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2012-06-29 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29  4:51 [PATCH] vmscan: remove obsolete comment of shrinker Minchan Kim
2012-06-29 13:15 ` Cong Wang
2012-06-29 22:32   ` Minchan 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).