From: Alexey Lyahkov <alexey.lyashkov@gmail.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Theodore Ts'o <tytso@mit.edu>, Andrew Perepechko <anserper@ya.ru>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Bernd Schubert <bernd.schubert@fastmail.fm>,
Will Huck <will.huckk@gmail.com>,
linux-ext4@vger.kernel.org, linux-mm@kvack.org
Subject: Re: page eviction from the buddy cache
Date: Fri, 26 Apr 2013 09:03:00 +0300 [thread overview]
Message-ID: <DEB7E312-8DF9-4923-B427-CCDE6B2A6298@gmail.com> (raw)
In-Reply-To: <20130425224035.GG2144@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]
On Apr 26, 2013, at 01:40, Mel Gorman wrote:
> No, I would prefer if this was not fixed within ext4. I need confirmation
> that fixing mark_page_accessed() addresses the performance problem you
> encounter. The two-line check for PageLRU() followed by a lru_add_drain()
> is meant to check that. That is still not my preferred fix because even
> if you do not encounter higher LRU contention, other workloads would be
> at risk. The likely fix will involve converting pagevecs to using a single
> list and then selecting what LRU to put a page on at drain time but I
> want to know that it's worthwhile.
>
> Using shake_page() in ext4 is certainly overkill.
agree, but it's was my prof of concept patch :) just to verify founded
>
>>> Andrew, can you try the following patch please? Also, is there any chance
>>> you can describe in more detail what the workload does?
>>
>> lustre OSS node + IOR with file size twice more then OSS memory.
>>
>
> Ok, no way I'll be reproducing that workload. Thanks.
>
I think you should be try several processes with DIO (so don't put any pages in lru_pagevec as that is heap), each have a filesize twice or more of available memory.
Main idea you should be have a read a new pages in budy cache (to allocate) and have large memory allocation in same time.
DIO chunk should be enough to start streaming allocation.
also you may use attached jprobe module to hit an BUG() if buddy page removed from a memory by shrinker.
[-- Attachment #2: jprobe-1.c --]
[-- Type: application/octet-stream, Size: 2943 bytes --]
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kprobes.h>
#include <linux/tracepoint.h>
#include <trace/events/kmem.h>
#include <linux/gfp.h>
#include <linux/pagemap.h>
#include <linux/memcontrol.h>
#include <linux/mm_inline.h>
#include <linux/swap.h>
#include <../fs/ext4/ext4.h>
struct address_space swapper_space;
int check_page(struct page *page)
{
struct inode *inode;
struct address_space *mapping;
struct ext4_sb_info *_sb;
mapping = page_mapping(page);
if ((mapping == NULL) || (mapping == &swapper_space))
goto end;
inode = mapping->host;
if (inode == NULL)
goto end;
if ((inode->i_sb == NULL) || (inode->i_sb->s_type == NULL))
goto end;
if (strcmp(inode->i_sb->s_type->name, "ldiskfs") != 0)
// if (strcmp(inode->i_sb->s_type->name, "ext4") != 0)
goto end;
_sb = EXT4_SB(inode->i_sb);
if (inode != _sb->s_buddy_cache)
goto end;
printk(KERN_ERR "found buddy %p %p\n", page, inode);
BUG();
return 1;
end:
return 0;
}
/* Proxy routine having the same arguments as actual do_fork() routine */
static int my__isolate_lru_page(struct page *page, int mode, int file)
{
if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
goto end;
if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
goto end;
check_page(page);
end:
/* Always end with a call to jprobe_return(). */
jprobe_return();
return 0;
}
static int my__remove_from_page_cache(struct page *page)
{
check_page(page);
jprobe_return();
return 0;
}
static struct jprobe my_jprobe1 = {
.entry = my__isolate_lru_page,
.kp = {
.symbol_name = "__isolate_lru_page",
},
};
static struct jprobe my_jprobe2 = {
.entry = my__remove_from_page_cache,
.kp = {
.symbol_name = "__remove_from_page_cache",
},
};
static void probe_mark_event(struct page *page)
{
check_page(page);
}
static int __init jprobe_init(void)
{
int ret;
ret = register_jprobe(&my_jprobe1);
if (ret < 0) {
printk(KERN_INFO "register_jprobe failed, returned %d\n", ret);
return -1;
}
printk(KERN_INFO "Planted jprobe at %p, handler addr %p\n",
my_jprobe1.kp.addr, my_jprobe1.entry);
ret = register_jprobe(&my_jprobe2);
if (ret < 0) {
printk(KERN_INFO "register_jprobe failed, returned %d\n", ret);
return -1;
}
printk(KERN_INFO "Planted jprobe at %p, handler addr %p\n",
my_jprobe2.kp.addr, my_jprobe2.entry);
// ret = register_trace_mm_vmscan_mark_accessed(probe_mark_event);
ret = register_trace_mm_vmscan_lru_move(probe_mark_event);
printk("register ret %d\n", ret);
WARN_ON(ret);
return 0;
}
static void __exit jprobe_exit(void)
{
unregister_jprobe(&my_jprobe1);
printk(KERN_INFO "jprobe at %p unregistered\n", my_jprobe1.kp.addr);
unregister_jprobe(&my_jprobe2);
printk(KERN_INFO "jprobe at %p unregistered\n", my_jprobe2.kp.addr);
unregister_trace_mm_vmscan_lru_move(probe_mark_event);
}
module_init(jprobe_init)
module_exit(jprobe_exit)
MODULE_LICENSE("GPL");
next prev parent reply other threads:[~2013-04-26 6:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <51504A40.6020604@ya.ru>
[not found] ` <20130327150743.GC14900@thunk.org>
2013-03-27 19:24 ` Hugh Dickins
2013-03-28 5:34 ` Alexey Lyahkov
2013-04-04 1:24 ` Will Huck
2013-04-04 4:51 ` Alexey Lyahkov
2013-04-20 21:18 ` Bernd Schubert
2013-04-20 23:57 ` Theodore Ts'o
2013-04-22 12:14 ` Alexey Lyahkov
2013-04-23 12:02 ` Bernd Schubert
2013-04-23 12:27 ` Theodore Ts'o
2013-04-23 19:57 ` Hugh Dickins
2013-04-23 22:00 ` Andrew Morton
2013-04-23 22:31 ` Hugh Dickins
2013-04-24 14:26 ` Theodore Ts'o
2013-04-24 21:41 ` Andrew Morton
2013-04-25 8:18 ` Alexey Lyahkov
2013-04-25 14:30 ` Mel Gorman
2013-04-25 18:37 ` Alexey Lyahkov
2013-04-25 22:40 ` Mel Gorman
2013-04-26 6:03 ` Alexey Lyahkov [this message]
2013-04-22 12:18 ` Alexey Lyahkov
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=DEB7E312-8DF9-4923-B427-CCDE6B2A6298@gmail.com \
--to=alexey.lyashkov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=anserper@ya.ru \
--cc=bernd.schubert@fastmail.fm \
--cc=hughd@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=tytso@mit.edu \
--cc=will.huckk@gmail.com \
/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