Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2768332ybc; Mon, 18 Nov 2019 04:27:22 -0800 (PST) X-Google-Smtp-Source: APXvYqy3PQYJ8em0cpOhRYoMU/RZaBAVInwt126DxgAWS286C5eYm4ZTLZ8c6NzKoJUG7D4Z5nCb X-Received: by 2002:a17:906:b25a:: with SMTP id ce26mr26322546ejb.13.1574080042698; Mon, 18 Nov 2019 04:27:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574080042; cv=none; d=google.com; s=arc-20160816; b=H/saDMoKo9wocXQvi5OCvSO/kpSuaIH6t6VdNyogbiTjX3/fxNGOum0Z/htZV7kdet RHnsm8El35Q3IxKDOgKeH2n3S/jSQYg2m8V54K7XPpAGlx5/ZjA34SQGfGNeZIZ6Iotv 22jqMgXqunQJE6ITNeVe/18GY1DwoTx+AP36XCwn2TJ7WAbr+XpNCOnIolGUXvBqfvuv 2pdImuPaPLfjwm5TT9vl7X6ZZPn9OrtUfpvVX6R5v4n/rwYJ7ycZtVMEbSjEmgppljOs Kajjge8kYsXwzEYg9kfr29zq+erRQ20vAciFLBcoSK4V/jClyx2qSRHk29vKXRUU4JKw +n6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=XobVpiw2Ak1XwuGRHUIb6074P0i0U6qpfrA8pwqfNO0=; b=obA6hhnunF0O/fSphJsWErlLdLDs3eEd+nzHwHHzTFunfg4Aj99Ltb6uVzkyG3L3aF FLIeTfHXX78er9VZ+hWy/LcRMk6OirxYZ+x318nup1kvVhU5ZjmLAFszklSlxnZ4I0jK hk7tfd9+aWn0l+CbTHj8di7Rp+IATNWs5quKDUJZcveHOsiiqZV/CepJL2qiLVn4gvXi N5NUlD0MWSuVSzfSKhL4uaGVtn8EsjxKu4k7hLtX8SaXgzOc869otcc1QoDFqNcZ/fGs CTCeNSjBUTZnuxzkBzcVQBQGVzurg6GRbx2XzScAQMP/0LrTry5iF8OMPiU+xDl45Ijn 9NIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i39si13793596eda.88.2019.11.18.04.26.58; Mon, 18 Nov 2019 04:27:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726739AbfKRMXW (ORCPT + 99 others); Mon, 18 Nov 2019 07:23:22 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:44977 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfKRMXV (ORCPT ); Mon, 18 Nov 2019 07:23:21 -0500 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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2019/11/16 下午3:03, Shakeel Butt 写道: >> +reget_lruvec: >> + lruvec = mem_cgroup_page_lruvec(page, pgdat); >> + >> /* If we already hold the lock, we can skip some rechecking */ >> - if (!locked) { >> - locked = compact_lock_irqsave(&pgdat->lru_lock, >> - &flags, cc); >> + if (lruvec != locked_lruvec) { >> + if (locked_lruvec) { >> + spin_unlock_irqrestore(&locked_lruvec->lru_lock, >> + locked_lruvec->irqflags); >> + locked_lruvec = 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(). > Thanks for comments, Shakeel. lruvec lifetime is same as memcg, which allocted in mem_cgroup_alloc()->alloc_mem_cgroup_per_node_info() I have read Hugh's patchset, even not every lines. But what's point of you here? > BTW have you tested Hugh's patches? > yes, I have tried the case-lru-file-readtwice on my machine w/o containers, it show a bit more regression. Thanks Alex