Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4092860ybl; Mon, 13 Jan 2020 07:44:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwhZI8IcpSFDD+0UW9Y7VuCqTSkkWvf6aQOA9KuHwouPTla+G3DXz0Y3ObF6DfkhY+rHJre X-Received: by 2002:aca:3141:: with SMTP id x62mr12548506oix.108.1578930262887; Mon, 13 Jan 2020 07:44:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578930262; cv=none; d=google.com; s=arc-20160816; b=yXrOXhFTsvC1U+RcSRy4Svl3/jyy6YjctY/C1gzucrh4DagMiSM9JvNSSDtGHjyFhn jagp8TV0B4l8PFvpos3wEMcOcFUZpn2+gDMzm/Ojtq2oa4wi0nO56PO5zJ0euRkTVC5J tE7kyqY8kctBcTrRuqoEha24EfZd7zhLPQcFV1Y+zbHwhLpUGIG6/BdOkNMPcINLujCa P8ObqdQxHJNAvK3t/bNxlplg2Gj+RtCvLDnyNVISlliXv5UGf86EvfcB0cj+7MR7rAU6 Kwe6dVO/RQ8e0SGpZauZtdc3I+KAB71A2egdUTLmM+SuO6cJPOv66NifoMUbb4Rq1btV jM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DaiMzq10P7q2znpRBBajknZMYi+ZtWubzic8NGU8mfo=; b=ssGNAFSAjxAvLGAv11vdzMnMnSRG8N8+vaeYl8UY0nB+iv9CPhrs7Xedhrf3VMUQGy pRVmZnFC23Ia9jCC6z5913cntqshRD2mIh3oQCaqTD2PZNQQEP7Cny0GQg10rewOwwdN kmNo3Y2Ngxx9ruheQNgHWqDfhUIRWEP+he0sZmideCNsurj5anYPuJxCdQ4Nz+Fr/+zm 4ptqj9aHDlLTdfhDNzYkMgtkmJGxiNvOvytxNuN17bxZNe3S70ZOmKsInKQgOnYJP11r 7i9Gy13v01zJLyzqvQhrI6B+01Zz2x9YQ1hiDHzEHdSKMYWTxFNFk6KoyoRpWxpW3pFs vKZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=sE8GHT2S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si5775648oig.199.2020.01.13.07.44.10; Mon, 13 Jan 2020 07:44: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; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=sE8GHT2S; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728779AbgAMPm7 (ORCPT + 99 others); Mon, 13 Jan 2020 10:42:59 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:41358 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgAMPm7 (ORCPT ); Mon, 13 Jan 2020 10:42:59 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00DFcw7o009205; Mon, 13 Jan 2020 15:41:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=DaiMzq10P7q2znpRBBajknZMYi+ZtWubzic8NGU8mfo=; b=sE8GHT2SDtHhjkzDOynzxChoJhv6zkVeBzHBdfCaY7p+DOvJXh69L7uo8fa07mQ/fMVr /miOInt1cI3EVZvZEziLjpafJrDa2xOrvUs5t+gLqTsIJ/PZVC+wb8Ip7ZV/BSb+Pzkv Uoihwv3ROB3y2pgzcZVXOkFpfMHJ+RfiWkfHV09AMKe45a4Wj26LQBsMJ3lY/WposRWF c16UC4OfUtsOIFzL4tJTnx3qBOzbirK88CUCIS6IPj2eZyUIxcuqcliUl0pg/cw8z703 7dCQsJ9IzjpzUWP04nR9rty4p7SVtX3wqO7FXMuHQiF8WrJKW2vIgmBjte4zpRaZdNzJ 9A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2xf73tfr9h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Jan 2020 15:41:24 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00DFdOHu063080; Mon, 13 Jan 2020 15:41:23 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2xfrghx04f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Jan 2020 15:41:23 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 00DFf9gR030155; Mon, 13 Jan 2020 15:41:09 GMT Received: from ca-dmjordan1.us.oracle.com (/10.211.9.48) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Jan 2020 07:41:08 -0800 Date: Mon, 13 Jan 2020 10:41:16 -0500 From: Daniel Jordan To: Alex Shi Cc: cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, shakeelb@google.com, hannes@cmpxchg.org, Michal Hocko , Vladimir Davydov , Roman Gushchin , Chris Down , Thomas Gleixner , Vlastimil Babka , Qian Cai , Andrey Ryabinin , "Kirill A. Shutemov" , =?utf-8?B?SsOpcsO0bWU=?= Glisse , 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 Subject: Re: [PATCH v7 03/10] mm/lru: replace pgdat lru_lock with lruvec lock Message-ID: <20200113154116.mwly5hl5yfvjkzl2@ca-dmjordan1.us.oracle.com> References: <1577264666-246071-1-git-send-email-alex.shi@linux.alibaba.com> <1577264666-246071-4-git-send-email-alex.shi@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1577264666-246071-4-git-send-email-alex.shi@linux.alibaba.com> User-Agent: NeoMutt/20180716 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9498 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=629 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001130130 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9498 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=696 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001130130 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/