From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E0ADC432C0 for ; Mon, 18 Nov 2019 12:23:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 09484206F4 for ; Mon, 18 Nov 2019 12:23:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 09484206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 988B96B000A; Mon, 18 Nov 2019 07:23:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 93AA06B000C; Mon, 18 Nov 2019 07:23:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 828426B0010; Mon, 18 Nov 2019 07:23:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id 6C4C56B000A for ; Mon, 18 Nov 2019 07:23:21 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 2B9C3180AD80F for ; Mon, 18 Nov 2019 12:23:21 +0000 (UTC) X-FDA: 76169313402.05.cub98_7478117476145 X-HE-Tag: cub98_7478117476145 X-Filterd-Recvd-Size: 4221 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Mon, 18 Nov 2019 12:23:20 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R871e4;CH=green;DM=||false|;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01422;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=38;SR=0;TI=SMTPD_---0TiTs0oQ_1574079792; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0TiTs0oQ_1574079792) by smtp.aliyun-inc.com(127.0.0.1); Mon, 18 Nov 2019 20:23:13 +0800 Subject: Re: [PATCH v3 3/7] mm/lru: replace pgdat lru_lock with lruvec lock To: Shakeel Butt Cc: Cgroups , LKML , Linux MM , Andrew Morton , Mel Gorman , Tejun Heo , Hugh Dickins , Konstantin Khlebnikov , Daniel Jordan , Yang Shi , Matthew Wilcox , Johannes Weiner , Michal Hocko , Vladimir Davydov , Roman Gushchin , Chris Down , Thomas Gleixner , Vlastimil Babka , Qian Cai , Andrey Ryabinin , "Kirill A. Shutemov" , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrea Arcangeli , David Rientjes , "Aneesh Kumar K.V" , swkhack , "Potyra, Stefan" , Mike Rapoport , Stephen Rothwell , Colin Ian King , Jason Gunthorpe , Mauro Carvalho Chehab , Peng Fan , Nikolay Borisov , Ira Weiny , Kirill Tkhai , Yafang Shao References: <1573874106-23802-1-git-send-email-alex.shi@linux.alibaba.com> <1573874106-23802-4-git-send-email-alex.shi@linux.alibaba.com> From: Alex Shi Message-ID: <3f179d84-85e2-bace-2dbc-e77f73883c71@linux.alibaba.com> Date: Mon, 18 Nov 2019 20:23:12 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: =E5=9C=A8 2019/11/16 =E4=B8=8B=E5=8D=883:03, Shakeel Butt =E5=86=99=E9=81= =93: >> +reget_lruvec: >> + lruvec =3D mem_cgroup_page_lruvec(page, pgdat); >> + >> /* If we already hold the lock, we can skip some reche= cking */ >> - if (!locked) { >> - locked =3D compact_lock_irqsave(&pgdat->lru_lo= ck, >> - &flags= , cc); >> + if (lruvec !=3D locked_lruvec) { >> + if (locked_lruvec) { >> + spin_unlock_irqrestore(&locked_lruvec-= >lru_lock, >> + locked_lruvec->irqflag= s); >> + locked_lruvec =3D NULL; >> + } > What guarantees the lifetime of lruvec? You should read the comment on > mem_cgroup_page_lruvec(). Have you seen the patches Hugh had shared? > Please look at the trylock_page_lruvec(). >=20 Thanks for comments, Shakeel. lruvec lifetime is same as memcg, which allocted in mem_cgroup_alloc()->a= lloc_mem_cgroup_per_node_info() I have read Hugh's patchset, even not every lines. But what's point of yo= u here? > BTW have you tested Hugh's patches? >=20 yes, I have tried the case-lru-file-readtwice on my machine w/o container= s, it show a bit more regression. Thanks Alex