lkml.org 
[lkml]   [2020]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 07/20] mm/lru: introduce TestClearPageLRU
On Mon,  2 Mar 2020 19:00:17 +0800 Alex Shi <alex.shi@linux.alibaba.com> wrote:

> Combined PageLRU check and ClearPageLRU into one function by new
> introduced func TestClearPageLRU. This function will be used as page
> isolation precondition.
>
> No functional change yet.
>
> ...
>
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2588,9 +2588,8 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg,
> pgdat = page_pgdat(page);
> spin_lock_irq(&pgdat->lru_lock);
>
> - if (PageLRU(page)) {
> + if (TestClearPageLRU(page)) {
> lruvec = mem_cgroup_page_lruvec(page, pgdat);
> - ClearPageLRU(page);
> del_page_from_lru_list(page, lruvec, page_lru(page));
> } else

The code will now get exclusive access of the page->flags cacheline and
will dirty that cacheline, even for !PageLRU() pages. What is the
performance impact of this?

\
 
 \ /
  Last update: 2020-03-02 23:12    [W:0.094 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site