All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: Jan Kara <jack@suse.cz>,
	UML devel <user-mode-linux-devel@lists.sourceforge.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: why does index in truncate_inode_pages_range() grows so much ?
Date: Wed, 11 Dec 2013 21:26:39 +0100	[thread overview]
Message-ID: <20131211202639.GE1163@quack.suse.cz> (raw)
In-Reply-To: <52A36389.7010103@gmx.de>

On Sat 07-12-13 19:06:01, Toralf Förster wrote:
> On 12/04/2013 02:06 PM, Jan Kara wrote:
> >   One idea: Can you add
> > WARN_ON(offset > 10000000);
> >   into mm/filemap.c:add_to_page_cache_locked() ? That should tell us
> > whether someone is indeed inserting pages with strange indices into page
> > cache or if page->index got somehow corrupted.
> > 
> >  								Honza
> >> > 
> 
> With this diff :
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index b7749a9..e95d90c 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -463,6 +463,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
> 
>         VM_BUG_ON(!PageLocked(page));
>         VM_BUG_ON(PageSwapBacked(page));
> +       WARN_ON(offset > 10000000);
> 
>         error = mem_cgroup_cache_charge(page, current->mm,
>                                         gfp_mask & GFP_RECLAIM_MASK);
> 
> 
> 
> I do get such things :
> 
> Dec  7 18:01:29 trinity tfoerste: M=1
> Dec  7 18:01:36 trinity kernel: type=1006 audit(1386435689.994:3): pid=1260 uid=0 old auid=4294967295 new auid=1000 old ses=4294967295 new ses=2 res=1
> Dec  7 18:01:42 trinity kernel: warning: process `trinity-child0' used the deprecated sysctl system call with
> Dec  7 18:01:42 trinity kernel: VFS: Warning: trinity-child0 using old stat() call. Recompile your binary.
> Dec  7 18:01:44 trinity kernel: ------------[ cut here ]------------
> Dec  7 18:01:44 trinity kernel: WARNING: CPU: 0 PID: 1478 at mm/filemap.c:466 add_to_page_cache_locked+0x34/0xf0()
> Dec  7 18:01:44 trinity kernel: CPU: 0 PID: 1478 Comm: trinity-child0 Not tainted 3.13.0-rc3-dirty #16
> Dec  7 18:01:44 trinity kernel: Stack:
> Dec  7 18:01:44 trinity kernel: 084c0773 084c0773 49be7ca8 00000004 085d0547 49be0000 00000000 084ce2d4
> Dec  7 18:01:44 trinity kernel: 49be7cb8 08425f7f 00000000 00000000 49be7cf0 0807d43b 084cc244 00000000
> Dec  7 18:01:44 trinity kernel: 000005c6 084ce2d4 000001d2 080cb714 080cb714 000001d2 49be7cfc 0b811b60
> Dec  7 18:01:44 trinity kernel: Call Trace:
> Dec  7 18:01:44 trinity kernel: [<08425f7f>] dump_stack+0x26/0x28
> Dec  7 18:01:44 trinity kernel: [<0807d43b>] warn_slowpath_common+0x7b/0xa0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<0807d503>] warn_slowpath_null+0x23/0x30
> Dec  7 18:01:44 trinity kernel: [<080cb714>] add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb7fb>] add_to_page_cache_lru+0x2b/0x50
> Dec  7 18:01:44 trinity kernel: [<080cd38b>] generic_file_aio_read+0x57b/0x710
> Dec  7 18:01:44 trinity kernel: [<081035ee>] do_sync_read+0x6e/0xa0
> Dec  7 18:01:44 trinity kernel: [<08104199>] vfs_read+0xa9/0x180
> Dec  7 18:01:44 trinity kernel: [<081047cc>] SyS_pread64+0x6c/0xa0
> Dec  7 18:01:44 trinity kernel: [<08062a94>] handle_syscall+0x64/0x80
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a072>] ? get_fp_registers+0x22/0x40
> Dec  7 18:01:44 trinity kernel: [<080750f5>] userspace+0x475/0x5f0
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a5d6>] ? os_set_thread_area+0x26/0x40
> Dec  7 18:01:44 trinity kernel: [<080795a0>] ? do_set_thread_area+0x20/0x50
> Dec  7 18:01:44 trinity kernel: [<08079718>] ? arch_switch_tls+0xb8/0x100
> Dec  7 18:01:44 trinity kernel: [<0805f750>] fork_handler+0x60/0x70
> Dec  7 18:01:44 trinity kernel:
> Dec  7 18:01:44 trinity kernel: ---[ end trace 7ce562aa9f07d154 ]---
  Thanks! So this works more or less as expected - trinity issued a read at
absurdly high offset so we created pagecache page a that offset and tried
to read data into it. That failed. We left the page in the pagecache where
it was for reclaim to reclaim it when free pages are needed. Everything
works as designed except we could possibly argue that it's not the most
efficient way to use pages...

Patch 'vfs: fix a bug when we do some dio reads with append dio writes'
(http://www.spinics.net/lists/linux-fsdevel/msg70899.html) should actually
change the situation and we won't unnecessarily cache these pages.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: Jan Kara <jack@suse.cz>,
	UML devel <user-mode-linux-devel@lists.sourceforge.net>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: why does index in truncate_inode_pages_range() grows so much ?
Date: Wed, 11 Dec 2013 21:26:39 +0100	[thread overview]
Message-ID: <20131211202639.GE1163@quack.suse.cz> (raw)
In-Reply-To: <52A36389.7010103@gmx.de>

On Sat 07-12-13 19:06:01, Toralf Forster wrote:
> On 12/04/2013 02:06 PM, Jan Kara wrote:
> >   One idea: Can you add
> > WARN_ON(offset > 10000000);
> >   into mm/filemap.c:add_to_page_cache_locked() ? That should tell us
> > whether someone is indeed inserting pages with strange indices into page
> > cache or if page->index got somehow corrupted.
> > 
> >  								Honza
> >> > 
> 
> With this diff :
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index b7749a9..e95d90c 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -463,6 +463,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
> 
>         VM_BUG_ON(!PageLocked(page));
>         VM_BUG_ON(PageSwapBacked(page));
> +       WARN_ON(offset > 10000000);
> 
>         error = mem_cgroup_cache_charge(page, current->mm,
>                                         gfp_mask & GFP_RECLAIM_MASK);
> 
> 
> 
> I do get such things :
> 
> Dec  7 18:01:29 trinity tfoerste: M=1
> Dec  7 18:01:36 trinity kernel: type=1006 audit(1386435689.994:3): pid=1260 uid=0 old auid=4294967295 new auid=1000 old ses=4294967295 new ses=2 res=1
> Dec  7 18:01:42 trinity kernel: warning: process `trinity-child0' used the deprecated sysctl system call with
> Dec  7 18:01:42 trinity kernel: VFS: Warning: trinity-child0 using old stat() call. Recompile your binary.
> Dec  7 18:01:44 trinity kernel: ------------[ cut here ]------------
> Dec  7 18:01:44 trinity kernel: WARNING: CPU: 0 PID: 1478 at mm/filemap.c:466 add_to_page_cache_locked+0x34/0xf0()
> Dec  7 18:01:44 trinity kernel: CPU: 0 PID: 1478 Comm: trinity-child0 Not tainted 3.13.0-rc3-dirty #16
> Dec  7 18:01:44 trinity kernel: Stack:
> Dec  7 18:01:44 trinity kernel: 084c0773 084c0773 49be7ca8 00000004 085d0547 49be0000 00000000 084ce2d4
> Dec  7 18:01:44 trinity kernel: 49be7cb8 08425f7f 00000000 00000000 49be7cf0 0807d43b 084cc244 00000000
> Dec  7 18:01:44 trinity kernel: 000005c6 084ce2d4 000001d2 080cb714 080cb714 000001d2 49be7cfc 0b811b60
> Dec  7 18:01:44 trinity kernel: Call Trace:
> Dec  7 18:01:44 trinity kernel: [<08425f7f>] dump_stack+0x26/0x28
> Dec  7 18:01:44 trinity kernel: [<0807d43b>] warn_slowpath_common+0x7b/0xa0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<0807d503>] warn_slowpath_null+0x23/0x30
> Dec  7 18:01:44 trinity kernel: [<080cb714>] add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb7fb>] add_to_page_cache_lru+0x2b/0x50
> Dec  7 18:01:44 trinity kernel: [<080cd38b>] generic_file_aio_read+0x57b/0x710
> Dec  7 18:01:44 trinity kernel: [<081035ee>] do_sync_read+0x6e/0xa0
> Dec  7 18:01:44 trinity kernel: [<08104199>] vfs_read+0xa9/0x180
> Dec  7 18:01:44 trinity kernel: [<081047cc>] SyS_pread64+0x6c/0xa0
> Dec  7 18:01:44 trinity kernel: [<08062a94>] handle_syscall+0x64/0x80
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a072>] ? get_fp_registers+0x22/0x40
> Dec  7 18:01:44 trinity kernel: [<080750f5>] userspace+0x475/0x5f0
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a5d6>] ? os_set_thread_area+0x26/0x40
> Dec  7 18:01:44 trinity kernel: [<080795a0>] ? do_set_thread_area+0x20/0x50
> Dec  7 18:01:44 trinity kernel: [<08079718>] ? arch_switch_tls+0xb8/0x100
> Dec  7 18:01:44 trinity kernel: [<0805f750>] fork_handler+0x60/0x70
> Dec  7 18:01:44 trinity kernel:
> Dec  7 18:01:44 trinity kernel: ---[ end trace 7ce562aa9f07d154 ]---
  Thanks! So this works more or less as expected - trinity issued a read at
absurdly high offset so we created pagecache page a that offset and tried
to read data into it. That failed. We left the page in the pagecache where
it was for reclaim to reclaim it when free pages are needed. Everything
works as designed except we could possibly argue that it's not the most
efficient way to use pages...

Patch 'vfs: fix a bug when we do some dio reads with append dio writes'
(http://www.spinics.net/lists/linux-fsdevel/msg70899.html) should actually
change the situation and we won't unnecessarily cache these pages.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

WARNING: multiple messages have this Message-ID (diff)
From: Jan Kara <jack@suse.cz>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: linux-mm@kvack.org, Jan Kara <jack@suse.cz>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	UML devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] why does index in truncate_inode_pages_range() grows so much ?
Date: Wed, 11 Dec 2013 21:26:39 +0100	[thread overview]
Message-ID: <20131211202639.GE1163@quack.suse.cz> (raw)
In-Reply-To: <52A36389.7010103@gmx.de>

On Sat 07-12-13 19:06:01, Toralf Förster wrote:
> On 12/04/2013 02:06 PM, Jan Kara wrote:
> >   One idea: Can you add
> > WARN_ON(offset > 10000000);
> >   into mm/filemap.c:add_to_page_cache_locked() ? That should tell us
> > whether someone is indeed inserting pages with strange indices into page
> > cache or if page->index got somehow corrupted.
> > 
> >  								Honza
> >> > 
> 
> With this diff :
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index b7749a9..e95d90c 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -463,6 +463,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
> 
>         VM_BUG_ON(!PageLocked(page));
>         VM_BUG_ON(PageSwapBacked(page));
> +       WARN_ON(offset > 10000000);
> 
>         error = mem_cgroup_cache_charge(page, current->mm,
>                                         gfp_mask & GFP_RECLAIM_MASK);
> 
> 
> 
> I do get such things :
> 
> Dec  7 18:01:29 trinity tfoerste: M=1
> Dec  7 18:01:36 trinity kernel: type=1006 audit(1386435689.994:3): pid=1260 uid=0 old auid=4294967295 new auid=1000 old ses=4294967295 new ses=2 res=1
> Dec  7 18:01:42 trinity kernel: warning: process `trinity-child0' used the deprecated sysctl system call with
> Dec  7 18:01:42 trinity kernel: VFS: Warning: trinity-child0 using old stat() call. Recompile your binary.
> Dec  7 18:01:44 trinity kernel: ------------[ cut here ]------------
> Dec  7 18:01:44 trinity kernel: WARNING: CPU: 0 PID: 1478 at mm/filemap.c:466 add_to_page_cache_locked+0x34/0xf0()
> Dec  7 18:01:44 trinity kernel: CPU: 0 PID: 1478 Comm: trinity-child0 Not tainted 3.13.0-rc3-dirty #16
> Dec  7 18:01:44 trinity kernel: Stack:
> Dec  7 18:01:44 trinity kernel: 084c0773 084c0773 49be7ca8 00000004 085d0547 49be0000 00000000 084ce2d4
> Dec  7 18:01:44 trinity kernel: 49be7cb8 08425f7f 00000000 00000000 49be7cf0 0807d43b 084cc244 00000000
> Dec  7 18:01:44 trinity kernel: 000005c6 084ce2d4 000001d2 080cb714 080cb714 000001d2 49be7cfc 0b811b60
> Dec  7 18:01:44 trinity kernel: Call Trace:
> Dec  7 18:01:44 trinity kernel: [<08425f7f>] dump_stack+0x26/0x28
> Dec  7 18:01:44 trinity kernel: [<0807d43b>] warn_slowpath_common+0x7b/0xa0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb714>] ? add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<0807d503>] warn_slowpath_null+0x23/0x30
> Dec  7 18:01:44 trinity kernel: [<080cb714>] add_to_page_cache_locked+0x34/0xf0
> Dec  7 18:01:44 trinity kernel: [<080cb7fb>] add_to_page_cache_lru+0x2b/0x50
> Dec  7 18:01:44 trinity kernel: [<080cd38b>] generic_file_aio_read+0x57b/0x710
> Dec  7 18:01:44 trinity kernel: [<081035ee>] do_sync_read+0x6e/0xa0
> Dec  7 18:01:44 trinity kernel: [<08104199>] vfs_read+0xa9/0x180
> Dec  7 18:01:44 trinity kernel: [<081047cc>] SyS_pread64+0x6c/0xa0
> Dec  7 18:01:44 trinity kernel: [<08062a94>] handle_syscall+0x64/0x80
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a072>] ? get_fp_registers+0x22/0x40
> Dec  7 18:01:44 trinity kernel: [<080750f5>] userspace+0x475/0x5f0
> Dec  7 18:01:44 trinity kernel: [<083d8831>] ? ptrace+0x31/0x80
> Dec  7 18:01:44 trinity kernel: [<0807a5d6>] ? os_set_thread_area+0x26/0x40
> Dec  7 18:01:44 trinity kernel: [<080795a0>] ? do_set_thread_area+0x20/0x50
> Dec  7 18:01:44 trinity kernel: [<08079718>] ? arch_switch_tls+0xb8/0x100
> Dec  7 18:01:44 trinity kernel: [<0805f750>] fork_handler+0x60/0x70
> Dec  7 18:01:44 trinity kernel:
> Dec  7 18:01:44 trinity kernel: ---[ end trace 7ce562aa9f07d154 ]---
  Thanks! So this works more or less as expected - trinity issued a read at
absurdly high offset so we created pagecache page a that offset and tried
to read data into it. That failed. We left the page in the pagecache where
it was for reclaim to reclaim it when free pages are needed. Everything
works as designed except we could possibly argue that it's not the most
efficient way to use pages...

Patch 'vfs: fix a bug when we do some dio reads with append dio writes'
(http://www.spinics.net/lists/linux-fsdevel/msg70899.html) should actually
change the situation and we won't unnecessarily cache these pages.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


  reply	other threads:[~2013-12-11 20:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24 15:14 why does index in truncate_inode_pages_range() grows so much ? Toralf Förster
2013-11-24 15:14 ` [uml-devel] " Toralf Förster
2013-11-25 13:55 ` stian
2013-12-03 14:02 ` Jan Kara
2013-12-03 14:02   ` Jan Kara
2013-12-03 19:43   ` Toralf Förster
2013-12-03 19:43     ` Toralf Förster
2013-12-03 23:00     ` Jan Kara
2013-12-03 23:00       ` Jan Kara
2013-12-03 23:00       ` Jan Kara
2013-12-04 13:06       ` Jan Kara
2013-12-04 13:06         ` [uml-devel] " Jan Kara
2013-12-04 13:06         ` Jan Kara
2013-12-07 18:06         ` Toralf Förster
2013-12-07 18:06           ` Toralf Förster
2013-12-07 18:06           ` Toralf Förster
2013-12-11 20:26           ` Jan Kara [this message]
2013-12-11 20:26             ` [uml-devel] " Jan Kara
2013-12-11 20:26             ` Jan Kara
2013-12-13  9:52             ` Toralf Förster
2013-12-13  9:52               ` Toralf Förster
2013-12-13  9:52               ` Toralf Förster
2013-12-13 10:51               ` [uml-devel] " Richard Weinberger
2013-12-13 10:51                 ` Richard Weinberger
2013-12-13 10:51                 ` Richard Weinberger
2013-12-13 13:01                 ` Toralf Förster
2013-12-13 13:01                   ` Toralf Förster
2013-12-13 13:01                   ` Toralf Förster
2013-12-13 19:10                   ` Jan Kara
2013-12-13 19:10                     ` Jan Kara
2013-12-13 19:10                     ` Jan Kara
2013-12-05 23:23       ` Toralf Förster
2013-12-05 23:23         ` Toralf Förster
2013-12-05 23:23         ` Toralf Förster

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=20131211202639.GE1163@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=toralf.foerster@gmx.de \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.