[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200113154116.mwly5hl5yfvjkzl2@ca-dmjordan1.us.oracle.com>
Date: Mon, 13 Jan 2020 10:41:16 -0500
From: Daniel Jordan <daniel.m.jordan@...cle.com>
To: Alex Shi <alex.shi@...ux.alibaba.com>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, akpm@...ux-foundation.org,
mgorman@...hsingularity.net, tj@...nel.org, hughd@...gle.com,
khlebnikov@...dex-team.ru, daniel.m.jordan@...cle.com,
yang.shi@...ux.alibaba.com, willy@...radead.org,
shakeelb@...gle.com, hannes@...xchg.org,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Roman Gushchin <guro@...com>,
Chris Down <chris@...isdown.name>,
Thomas Gleixner <tglx@...utronix.de>,
Vlastimil Babka <vbabka@...e.cz>, Qian Cai <cai@....pw>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Jérôme Glisse <jglisse@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>,
David Rientjes <rientjes@...gle.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>,
swkhack <swkhack@...il.com>,
"Potyra, Stefan" <Stefan.Potyra@...ktrobit.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Colin Ian King <colin.king@...onical.com>,
Jason Gunthorpe <jgg@...pe.ca>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Peng Fan <peng.fan@....com>,
Nikolay Borisov <nborisov@...e.com>,
Ira Weiny <ira.weiny@...el.com>,
Kirill Tkhai <ktkhai@...tuozzo.com>,
Yafang Shao <laoar.shao@...il.com>
Subject: Re: [PATCH v7 03/10] mm/lru: replace pgdat lru_lock with lruvec lock
Hi Alex,
On Wed, Dec 25, 2019 at 05:04:19PM +0800, Alex Shi wrote:
> @@ -900,6 +904,29 @@ static inline struct lruvec *mem_cgroup_page_lruvec(struct page *page,
> {
> return &pgdat->__lruvec;
> }
> +#define lock_page_lruvec_irq(page) \
> +({ \
> + struct pglist_data *pgdat = page_pgdat(page); \
> + spin_lock_irq(&pgdat->__lruvec.lru_lock); \
> + &pgdat->__lruvec; \
> +})
> +
> +#define lock_page_lruvec_irqsave(page, flagsp) \
> +({ \
> + struct pglist_data *pgdat = page_pgdat(page); \
> + spin_lock_irqsave(&pgdat->__lruvec.lru_lock, *flagsp); \
> + &pgdat->__lruvec; \
> +})
> +
> +#define unlock_page_lruvec_irq(lruvec) \
> +({ \
> + spin_unlock_irq(&lruvec->lru_lock); \
> +})
> +
> +#define unlock_page_lruvec_irqrestore(lruvec, flags) \
> +({ \
> + spin_unlock_irqrestore(&lruvec->lru_lock, flags); \
> +})
Noticed this while testing your series. These are safe as inline functions, so
I think you may have gotten the wrong impression when Johannes made this point:
https://lore.kernel.org/linux-mm/20191119164448.GA396644@cmpxchg.org/
Powered by blists - more mailing lists