All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Michal Hocko <mhocko@suse.com>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>
Subject: Re: [PATCH v3 13/18] mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock()
Date: Wed, 7 Jul 2021 16:10:49 +0100	[thread overview]
Message-ID: <YOXD+TVkAeWmjLxX@casper.infradead.org> (raw)
In-Reply-To: <YNwsAh5u2h34tGDb@dhcp22.suse.cz>

On Wed, Jun 30, 2021 at 10:32:02AM +0200, Michal Hocko wrote:
> On Wed 30-06-21 05:00:29, Matthew Wilcox wrote:
> > These are the folio equivalents of lock_page_memcg() and
> > unlock_page_memcg().  Reimplement them as wrappers.
> 
> Is there any reason why you haven't followed the same approach as for
> the previous patches. I mean callers can call page_folio and then
> lock_page_memcg wrapper shouldn't be really needed.

At this point in the patch series there are ~20 places which call
lock_page_memcg().  I think it makes more sense to leave the wrapper
in place, and then we can remove the wrapper once all/most of these
places are converted to use folios.  There are another 5 conversions
already in the patch series, eg here:

https://git.infradead.org/users/willy/pagecache.git/commitdiff/a41c942c8e4b41df30be128ef6998ff1849fa36a

> I do not really want to be annoying here but I have to say that I like
> the conversion by previous patches much better than this wrapper
> approach as mentioned during the previous review already. If you have
> some reasons to stick with this approach for this particular case then
> make it explicit in the changelog.

OK, I can point to the number of callers as a reason to keep the
wrappers in place.  I intended to just do the conversion here, but
seeing the number of callers made me reconsider.


WARNING: multiple messages have this Message-ID (diff)
From: Matthew Wilcox <willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Vladimir Davydov
	<vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v3 13/18] mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock()
Date: Wed, 7 Jul 2021 16:10:49 +0100	[thread overview]
Message-ID: <YOXD+TVkAeWmjLxX@casper.infradead.org> (raw)
In-Reply-To: <YNwsAh5u2h34tGDb-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>

On Wed, Jun 30, 2021 at 10:32:02AM +0200, Michal Hocko wrote:
> On Wed 30-06-21 05:00:29, Matthew Wilcox wrote:
> > These are the folio equivalents of lock_page_memcg() and
> > unlock_page_memcg().  Reimplement them as wrappers.
> 
> Is there any reason why you haven't followed the same approach as for
> the previous patches. I mean callers can call page_folio and then
> lock_page_memcg wrapper shouldn't be really needed.

At this point in the patch series there are ~20 places which call
lock_page_memcg().  I think it makes more sense to leave the wrapper
in place, and then we can remove the wrapper once all/most of these
places are converted to use folios.  There are another 5 conversions
already in the patch series, eg here:

https://git.infradead.org/users/willy/pagecache.git/commitdiff/a41c942c8e4b41df30be128ef6998ff1849fa36a

> I do not really want to be annoying here but I have to say that I like
> the conversion by previous patches much better than this wrapper
> approach as mentioned during the previous review already. If you have
> some reasons to stick with this approach for this particular case then
> make it explicit in the changelog.

OK, I can point to the number of callers as a reason to keep the
wrappers in place.  I intended to just do the conversion here, but
seeing the number of callers made me reconsider.

  reply	other threads:[~2021-07-07 15:11 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30  4:00 [PATCH v3 00/18] Folio conversion of memcg Matthew Wilcox (Oracle)
2021-06-30  4:00 ` Matthew Wilcox (Oracle)
2021-06-30  4:00 ` [PATCH v3 01/18] mm: Add folio_nid() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-07-01  6:56   ` Christoph Hellwig
2021-07-01  6:56     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 02/18] mm/memcg: Remove 'page' parameter to mem_cgroup_charge_statistics() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30 14:17   ` Johannes Weiner
2021-06-30 14:17     ` Johannes Weiner
2021-06-30  4:00 ` [PATCH v3 03/18] mm/memcg: Use the node id in mem_cgroup_update_tree() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  6:55   ` Michal Hocko
2021-06-30  6:55     ` Michal Hocko
2021-06-30 14:18   ` Johannes Weiner
2021-06-30 14:18     ` Johannes Weiner
2021-07-01  6:57   ` Christoph Hellwig
2021-07-01  6:57     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 04/18] mm/memcg: Remove soft_limit_tree_node() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  6:56   ` Michal Hocko
2021-06-30  6:56     ` Michal Hocko
2021-06-30 14:19   ` Johannes Weiner
2021-06-30 14:19     ` Johannes Weiner
2021-07-01  7:09   ` Christoph Hellwig
2021-07-01  7:09     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 05/18] mm/memcg: Convert memcg_check_events to take a node ID Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  6:58   ` Michal Hocko
2021-06-30  6:58     ` Michal Hocko
2021-06-30  6:59     ` Michal Hocko
2021-06-30  6:59       ` Michal Hocko
2021-07-01  7:09   ` Christoph Hellwig
2021-07-01  7:09     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 06/18] mm/memcg: Add folio_memcg() and related functions Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  6:53   ` kernel test robot
2021-06-30  6:53     ` kernel test robot
2021-06-30  6:53     ` kernel test robot
2021-07-01  7:12   ` Christoph Hellwig
2021-07-01  7:12     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 07/18] mm/memcg: Convert commit_charge() to take a folio Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  4:00 ` [PATCH v3 08/18] mm/memcg: Convert mem_cgroup_charge() " Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  7:17   ` kernel test robot
2021-06-30  7:17     ` kernel test robot
2021-06-30  7:17     ` kernel test robot
2021-07-01  7:13   ` Christoph Hellwig
2021-07-01  7:13     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 09/18] mm/memcg: Convert uncharge_page() to uncharge_folio() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-07-01  7:15   ` Christoph Hellwig
2021-07-01  7:15     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 10/18] mm/memcg: Convert mem_cgroup_uncharge() to take a folio Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:46   ` kernel test robot
2021-06-30  8:46     ` kernel test robot
2021-06-30  8:46     ` kernel test robot
2021-07-01  7:17   ` Christoph Hellwig
2021-07-01  7:17     ` Christoph Hellwig
2021-07-07 12:09     ` Matthew Wilcox
2021-07-07 12:09       ` Matthew Wilcox
2021-06-30  4:00 ` [PATCH v3 11/18] mm/memcg: Convert mem_cgroup_migrate() to take folios Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-07-01  7:20   ` Christoph Hellwig
2021-07-01  7:20     ` Christoph Hellwig
2021-06-30  4:00 ` [PATCH v3 12/18] mm/memcg: Convert mem_cgroup_track_foreign_dirty_slowpath() to folio Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  4:00 ` [PATCH v3 13/18] mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:32   ` Michal Hocko
2021-06-30  8:32     ` Michal Hocko
2021-07-07 15:10     ` Matthew Wilcox [this message]
2021-07-07 15:10       ` Matthew Wilcox
2021-07-08  7:28       ` Michal Hocko
2021-07-08  7:28         ` Michal Hocko
2021-07-07 17:08   ` Johannes Weiner
2021-07-07 17:08     ` Johannes Weiner
2021-07-07 19:28     ` Matthew Wilcox
2021-07-07 19:28       ` Matthew Wilcox
2021-07-07 20:41       ` Johannes Weiner
2021-07-07 20:41         ` Johannes Weiner
2021-07-09 19:37         ` Matthew Wilcox
2021-07-09 19:37           ` Matthew Wilcox
2021-06-30  4:00 ` [PATCH v3 14/18] mm/memcg: Convert mem_cgroup_move_account() to use a folio Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:30   ` Michal Hocko
2021-06-30  8:30     ` Michal Hocko
2021-06-30 11:22     ` Matthew Wilcox
2021-06-30 11:22       ` Matthew Wilcox
2021-06-30 12:20       ` Michal Hocko
2021-06-30 12:20         ` Michal Hocko
2021-06-30 12:31         ` Matthew Wilcox
2021-06-30 12:31           ` Matthew Wilcox
2021-06-30 12:45           ` Michal Hocko
2021-06-30 12:45             ` Michal Hocko
2021-07-07 15:25             ` Matthew Wilcox
2021-07-07 15:25               ` Matthew Wilcox
2021-07-08  7:30               ` Michal Hocko
2021-07-08  7:30                 ` Michal Hocko
2021-06-30  4:00 ` [PATCH v3 15/18] mm/memcg: Add mem_cgroup_folio_lruvec() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:12   ` kernel test robot
2021-06-30  8:12     ` kernel test robot
2021-06-30  8:12     ` kernel test robot
2021-06-30 19:18   ` Matthew Wilcox
2021-06-30 19:18     ` Matthew Wilcox
2021-06-30 21:21     ` Johannes Weiner
2021-06-30 21:21       ` Johannes Weiner
2021-06-30  4:00 ` [PATCH v3 16/18] mm/memcg: Add folio_lruvec_lock() and similar functions Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:36   ` Michal Hocko
2021-06-30  8:36     ` Michal Hocko
2021-06-30  4:00 ` [PATCH v3 17/18] mm/memcg: Add folio_lruvec_relock_irq() and folio_lruvec_relock_irqsave() Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:39   ` Michal Hocko
2021-06-30  8:39     ` Michal Hocko
2021-06-30  4:00 ` [PATCH v3 18/18] mm/workingset: Convert workingset_activation to take a folio Matthew Wilcox (Oracle)
2021-06-30  4:00   ` Matthew Wilcox (Oracle)
2021-06-30  8:44 ` [PATCH v3 00/18] Folio conversion of memcg Michal Hocko
2021-06-30  8:44   ` Michal Hocko

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=YOXD+TVkAeWmjLxX@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vdavydov.dev@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.