Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp10821imb; Thu, 28 Feb 2019 14:21:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwhBvxV6Lhgljqke1WT9MDQEUI2tmwNPwJb7EWzNqlVtRcoaeJe1AUhI+eunBBMSkjmUL5g X-Received: by 2002:a63:4a4d:: with SMTP id j13mr1463829pgl.16.1551392466954; Thu, 28 Feb 2019 14:21:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551392466; cv=none; d=google.com; s=arc-20160816; b=HPw6Z2D+489pV6yrdHWV3WDJ3HVvOxJ/Y6wlRnT32Sl1hmMFpTJm0fVbxX4wui2YFD Kc/4C0QfQoCGyjUz97jYaY8UDq1fR7TDToDdZ6WKDRKmXME0mwMZoPkGNAWzLHCjYzQU YlONula7sgUHCFltEXSx6+KyDtbyCBR8ieiFb/GhWvW5A/dXK25aIm8svfUkgUhwrvH1 35+irDLjRd6X5d0Fq+BcqIl7o3ZG4ziJs9+Ziy7ZEbveoa17RfrQkfzX2+uqdV2KBR4j L4hwABAIE92LsExI9ISgrCB3a6J5zYUSLv6kPDsw5N/22VJaeSzX3xjg9IjJkoC4TZlh M0Bw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=G9FVqmPGfbV2nh5IFsLul1hD5yn9e1TBUbSLtPF4MaU=; b=DqeigX5p2cdaGzxD2u/sFJxqzzZX3nde7aI5LQOnDQtbnrqjNlKf0zdKVIG3xrvTs9 W0t0sPU3WdnxuSt4Fv66sfKXRyKXBI/LaiyMtwTRTf8RekVQvXWsIx0SpPkIPEbu4cd8 OM+33GcsGG8HDf7fLv5stvMJrw42+v/H1K1f7aTW3uA4OIiVp7TNmgn3jy8135DCH6NN i3A32dLC3Jh/ff3BqnYMhxEAva3fI/5b7+91MvIV2tKlBYmDA7X7a+iMLRAGDpDQSlpq JUadDbw+RCY8O73noGeF6g9ZoU4EMhIvcBJ/jD9ySLO+mzNPwSzQj0m2LG+zEO5cJI/s GWaw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r15si17362245pgv.389.2019.02.28.14.20.51; Thu, 28 Feb 2019 14:21:06 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731797AbfB1V4t (ORCPT + 99 others); Thu, 28 Feb 2019 16:56:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:47648 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726088AbfB1V4t (ORCPT ); Thu, 28 Feb 2019 16:56:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 04C3AADD6; Thu, 28 Feb 2019 21:56:47 +0000 (UTC) Subject: Re: [PATCH v2 2/4] mm: remove zone_lru_lock() function access ->lru_lock directly To: John Hubbard , Andrey Ryabinin , Andrew Morton Cc: Johannes Weiner , Rik van Riel , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Mel Gorman References: <20190228083329.31892-1-aryabinin@virtuozzo.com> <20190228083329.31892-2-aryabinin@virtuozzo.com> <44ffadb4-4235-76c9-332f-680dda5da521@nvidia.com> From: Vlastimil Babka Message-ID: <67a79bb9-12b5-e668-abb1-ef91a9cbfea8@suse.cz> Date: Thu, 28 Feb 2019 22:56:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <44ffadb4-4235-76c9-332f-680dda5da521@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/28/2019 10:44 PM, John Hubbard wrote: > Instead of removing that function, let's change it, and add another > (since you have two cases: either a page* or a pgdat* is available), > and move it to where it can compile, like this: > > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 80bb6408fe73..cea3437f5d68 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1167,6 +1167,16 @@ static inline pg_data_t *page_pgdat(const struct page *page) > return NODE_DATA(page_to_nid(page)); > } > > +static inline spinlock_t *zone_lru_lock(pg_data_t *pgdat) In that case it should now be named node_lru_lock(). zone_lru_lock() was a wrapper introduced to make the conversion of per-zone to per-node lru_lock smoother. > +{ > + return &pgdat->lru_lock; > +} > + > +static inline spinlock_t *zone_lru_lock_from_page(struct page *page) Ditto. Or maybe even page_node_lru_lock()? > +{ > + return zone_lru_lock(page_pgdat(page)); > +} > + > #ifdef SECTION_IN_PAGE_FLAGS > static inline void set_page_section(struct page *page, unsigned long section) > { > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 842f9189537b..e03042fe1d88 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -728,11 +728,6 @@ typedef struct pglist_data { > > #define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) > #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid)) > -static inline spinlock_t *zone_lru_lock(struct zone *zone) > -{ > - return &zone->zone_pgdat->lru_lock; > -} > - > static inline struct lruvec *node_lruvec(struct pglist_data *pgdat) > { > return &pgdat->lruvec; > > > > Like it? > > thanks, >