mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: John Hubbard <jhubbard@nvidia.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Rik van Riel <riel@surriel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Michal Hocko <mhocko@kernel.org>,
	Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH v2 2/4] mm: remove zone_lru_lock() function access ->lru_lock directly
Date: Thu, 28 Feb 2019 22:56:35 +0100	[thread overview]
Message-ID: <67a79bb9-12b5-e668-abb1-ef91a9cbfea8@suse.cz> (raw)
In-Reply-To: <44ffadb4-4235-76c9-332f-680dda5da521@nvidia.com>

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,
> 


  reply	other threads:[~2019-02-28 21:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28  8:33 [PATCH v2 1/4] mm/workingset: remove unused @mapping argument in workingset_eviction() Andrey Ryabinin
2019-02-28  8:33 ` [PATCH v2 2/4] mm: remove zone_lru_lock() function access ->lru_lock directly Andrey Ryabinin
2019-02-28 11:33   ` Mel Gorman
2019-02-28 12:53   ` William Kucharski
2019-02-28 18:22     ` Andrew Morton
2019-02-28 21:32       ` William Kucharski
2019-02-28 21:44   ` John Hubbard
2019-02-28 21:56     ` Vlastimil Babka [this message]
2019-02-28 22:11       ` John Hubbard
2019-03-01 10:51     ` Andrey Ryabinin
2019-03-01 19:58       ` John Hubbard
2019-02-28  8:33 ` [PATCH v2 3/4] mm/compaction: pass pgdat to too_many_isolated() instead of zone Andrey Ryabinin
2019-02-28 11:33   ` Mel Gorman
2019-02-28  8:33 ` [PATCH v2 4/4] mm/vmscan: remove unused lru_pages argument Andrey Ryabinin
2019-02-28 11:34   ` Mel Gorman
2019-02-28  8:40 ` [PATCH v2 1/4] mm/workingset: remove unused @mapping argument in workingset_eviction() Vlastimil Babka
2019-02-28 11:27 ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67a79bb9-12b5-e668-abb1-ef91a9cbfea8@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=hannes@cmpxchg.org \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=riel@surriel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®