linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: account reaped page cache on inode cache pruning
@ 2011-11-16 14:47 Konstantin Khlebnikov
  2011-11-18  0:23 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Konstantin Khlebnikov @ 2011-11-16 14:47 UTC (permalink / raw)
  To: linux-mm, linux-kernel; +Cc: Andrew Morton

Inode cache pruning indirectly reclaims page-cache by invalidating mapping pages.
Let's account them into reclaim-state to notice this progress in memory reclaimer.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
 fs/inode.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index ee4e66b..1f6c48d 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -692,6 +692,8 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
 	else
 		__count_vm_events(PGINODESTEAL, reap);
 	spin_unlock(&sb->s_inode_lru_lock);
+	if (current->reclaim_state)
+		current->reclaim_state->reclaimed_slab += reap;
 
 	dispose_list(&freeable);
 }

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: account reaped page cache on inode cache pruning
  2011-11-16 14:47 [PATCH] mm: account reaped page cache on inode cache pruning Konstantin Khlebnikov
@ 2011-11-18  0:23 ` Andrew Morton
  2011-11-18  6:42   ` Konstantin Khlebnikov
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2011-11-18  0:23 UTC (permalink / raw)
  To: Konstantin Khlebnikov; +Cc: linux-mm, linux-kernel, Dave Chinner

On Wed, 16 Nov 2011 17:47:13 +0300
Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:

> Inode cache pruning indirectly reclaims page-cache by invalidating mapping pages.
> Let's account them into reclaim-state to notice this progress in memory reclaimer.
> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
>  fs/inode.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index ee4e66b..1f6c48d 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -692,6 +692,8 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
>  	else
>  		__count_vm_events(PGINODESTEAL, reap);
>  	spin_unlock(&sb->s_inode_lru_lock);
> +	if (current->reclaim_state)
> +		current->reclaim_state->reclaimed_slab += reap;
>  
>  	dispose_list(&freeable);
>  }

hm, yes, I suppose we should.

It seems to be cheating to use the "reclaimed_slab" field for this. 
Perhaps it would be cleaner to add an additional field to reclaim_state
for non-slab pages which were also reclaimed.  That's a cosmetic thing
and I guess we don't need to go that far, not sure...


--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: account reaped page cache on inode cache pruning
  2011-11-18  0:23 ` Andrew Morton
@ 2011-11-18  6:42   ` Konstantin Khlebnikov
  2011-11-18  6:52     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Konstantin Khlebnikov @ 2011-11-18  6:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Chinner

Andrew Morton wrote:
> On Wed, 16 Nov 2011 17:47:13 +0300
> Konstantin Khlebnikov<khlebnikov@openvz.org>  wrote:
>
>> Inode cache pruning indirectly reclaims page-cache by invalidating mapping pages.
>> Let's account them into reclaim-state to notice this progress in memory reclaimer.
>>
>> Signed-off-by: Konstantin Khlebnikov<khlebnikov@openvz.org>
>> ---
>>   fs/inode.c |    2 ++
>>   1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/inode.c b/fs/inode.c
>> index ee4e66b..1f6c48d 100644
>> --- a/fs/inode.c
>> +++ b/fs/inode.c
>> @@ -692,6 +692,8 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
>>   	else
>>   		__count_vm_events(PGINODESTEAL, reap);
>>   	spin_unlock(&sb->s_inode_lru_lock);
>> +	if (current->reclaim_state)
>> +		current->reclaim_state->reclaimed_slab += reap;
>>
>>   	dispose_list(&freeable);
>>   }
>
> hm, yes, I suppose we should.
>
> It seems to be cheating to use the "reclaimed_slab" field for this.
> Perhaps it would be cleaner to add an additional field to reclaim_state
> for non-slab pages which were also reclaimed.  That's a cosmetic thing
> and I guess we don't need to go that far, not sure...

Do we really need separate on-stack reclaim_state structure with single field?
Maybe replace it with single long (or even unsigned int) .reclaimed_pages field on task_struct
and account reclaimed pages unconditionally.

>
>

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: account reaped page cache on inode cache pruning
  2011-11-18  6:42   ` Konstantin Khlebnikov
@ 2011-11-18  6:52     ` Andrew Morton
  2011-11-18  7:32       ` Konstantin Khlebnikov
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2011-11-18  6:52 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Chinner

On Fri, 18 Nov 2011 10:42:50 +0400 Konstantin Khlebnikov <khlebnikov@openvz.org> wrote:

> Do we really need separate on-stack reclaim_state structure with single field?
> Maybe replace it with single long (or even unsigned int) .reclaimed_pages field on task_struct
> and account reclaimed pages unconditionally.

I don't think it matters a lot - it's either a temporary pointer on the
stack or a permanent space consumption in the task_struct.

The way thing are at present we can easily add new fields if needed.  I
don't think we've ever done that though.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] mm: account reaped page cache on inode cache pruning
  2011-11-18  6:52     ` Andrew Morton
@ 2011-11-18  7:32       ` Konstantin Khlebnikov
  0 siblings, 0 replies; 5+ messages in thread
From: Konstantin Khlebnikov @ 2011-11-18  7:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dave Chinner

Andrew Morton wrote:
> On Fri, 18 Nov 2011 10:42:50 +0400 Konstantin Khlebnikov<khlebnikov@openvz.org>  wrote:
>
>> Do we really need separate on-stack reclaim_state structure with single field?
>> Maybe replace it with single long (or even unsigned int) .reclaimed_pages field on task_struct
>> and account reclaimed pages unconditionally.
>
> I don't think it matters a lot - it's either a temporary pointer on the
> stack or a permanent space consumption in the task_struct.

Yes, but currently task_struct has permanent pointer to reclaim_state =)

>
> The way thing are at present we can easily add new fields if needed.  I
> don't think we've ever done that though.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-11-18  7:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 14:47 [PATCH] mm: account reaped page cache on inode cache pruning Konstantin Khlebnikov
2011-11-18  0:23 ` Andrew Morton
2011-11-18  6:42   ` Konstantin Khlebnikov
2011-11-18  6:52     ` Andrew Morton
2011-11-18  7:32       ` Konstantin Khlebnikov

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).