Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp310650pxb; Thu, 12 Nov 2020 04:35:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1zcTJWKmpl6GXF7InZb49vFwTEntazRRQSVOwyUr8vLps83CpqYl0cuMXMllLczxeL0KW X-Received: by 2002:aa7:c7d9:: with SMTP id o25mr5096428eds.318.1605184516028; Thu, 12 Nov 2020 04:35:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605184516; cv=none; d=google.com; s=arc-20160816; b=0pMCleb4CJaON/nstkPkR5InV+fjOE8dgW08e5FTn+/2EsygFuHGg50JlzpGcj2T/e t2Ams47rMokajdBMYUYPoIyDlYmCxwHWUIQU7/N/DLVkXRg1yAH98xzyQDV0tZO4lPAU RNnVqgawmYCVzLuytiMLgwOJO58d/v5e2QqVLwRASeovhMv1TBXIdeXQeHIHmwitlCn+ 4LID5iDlUkC/fA+LMv8/txEdIBWgVA2kGkrcFFL7cNwlkFHpwdQXWTRaIzylgS/jvoq1 arjozRNf5dNjah/fgvQeJW7opygnl/ZDpnihbVZWQKxfPZ5adICDExZX1N62SgE0EEJ3 ZOpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=dXbM7puXEh1UnF7XmGly00OwWnwKyVLY26E5lSW3qvc=; b=PBeA/jQ/HcSL35JlrQQiAsxIPkwOCUFZbtuMD37jdYLHHsmQkzGJZvBLlC/ExkjYcz yKchQZrOSGJWBOhrYnX8HMKHwU94VkOL/m1yzWQcqffWe0/J/7v6umAlLgUj7v+AhTFD rwKHyEQGYAvV93LTP5hgC9wT3stAnl8aasAG9xOv8AjEr2ndOYuy2Yw5rxsZH7EcCbOs SssdgZ9onLla482HFRIk6gVFOK/Dyu+hpa4bz5KxqGdIdpig0ERYHMCjNxXI0aPPh9j9 j1cF3k7iYpBae//7epJ832PR8Wtobxi71jF/SPtVukb9E8mH4D4eSHkq2vn/XbZCQu+6 SQLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx12si3800664edb.507.2020.11.12.04.34.52; Thu, 12 Nov 2020 04:35:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbgKLMbH (ORCPT + 99 others); Thu, 12 Nov 2020 07:31:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:54796 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbgKLMbH (ORCPT ); Thu, 12 Nov 2020 07:31:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3D1FFAC6F; Thu, 12 Nov 2020 12:31:05 +0000 (UTC) Subject: Re: [PATCH v21 18/19] mm/lru: introduce the relock_page_lruvec function To: Alex Shi , akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com Cc: Alexander Duyck , Thomas Gleixner , Andrey Ryabinin References: <1604566549-62481-1-git-send-email-alex.shi@linux.alibaba.com> <1604566549-62481-19-git-send-email-alex.shi@linux.alibaba.com> From: Vlastimil Babka Message-ID: <5bd37d82-6a46-84eb-7110-411bc5e6515c@suse.cz> Date: Thu, 12 Nov 2020 13:31:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <1604566549-62481-19-git-send-email-alex.shi@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/20 9:55 AM, Alex Shi wrote: > From: Alexander Duyck > > Use this new function to replace repeated same code, no func change. > > When testing for relock we can avoid the need for RCU locking if we simply > compare the page pgdat and memcg pointers versus those that the lruvec is > holding. By doing this we can avoid the extra pointer walks and accesses of > the memory cgroup. Ah, clever. Seems to address my worry from previous patch (except the potential to improve documenting comments). > In addition we can avoid the checks entirely if lruvec is currently NULL. > > Signed-off-by: Alexander Duyck > Signed-off-by: Alex Shi > Acked-by: Hugh Dickins > Acked-by: Johannes Weiner Acked-by: Vlastimil Babka > Cc: Johannes Weiner > Cc: Andrew Morton > Cc: Thomas Gleixner > Cc: Andrey Ryabinin > Cc: Matthew Wilcox > Cc: Mel Gorman > Cc: Konstantin Khlebnikov > Cc: Hugh Dickins > Cc: Tejun Heo > Cc: linux-kernel@vger.kernel.org > Cc: cgroups@vger.kernel.org > Cc: linux-mm@kvack.org