linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Suren Baghdasaryan <surenb@google.com>
Subject: Re: linux-next: manual merge of the akpm-current tree with the folio tree
Date: Mon, 6 Sep 2021 13:12:11 +0100	[thread overview]
Message-ID: <YTYFm1Ca8LHvrlyq@casper.infradead.org> (raw)
In-Reply-To: <20210906144807.4db0790f@canb.auug.org.au>

On Mon, Sep 06, 2021 at 02:48:07PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> On Wed, 21 Jul 2021 16:31:18 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > Today's linux-next merge of the akpm-current tree got conflicts in:
> > 
> >   include/linux/memcontrol.h
> >   mm/memcontrol.c
> > 
> > between commits:
> > 
> >   05bb7bbab428 ("mm/memcg: Convert mem_cgroup_charge() to take a folio")
> >   8b2afb6a1c34 ("mm/memcg: Convert mem_cgroup_uncharge() to take a folio")
> > 
> > from the folio tree and commit:
> > 
> >   1f4c6a1cf274 ("mm, memcg: inline mem_cgroup_{charge/uncharge} to improve disabled memcg config")
> > 
> > from the akpm-current tree.
> > 
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging.  You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
> > 
> > diff --cc include/linux/memcontrol.h
> > index af9c44bb1e42,406058a0c480..000000000000
> > --- a/include/linux/memcontrol.h
> > +++ b/include/linux/memcontrol.h
> > @@@ -704,15 -691,37 +702,36 @@@ static inline bool mem_cgroup_below_min
> >   		page_counter_read(&memcg->memory);
> >   }
> >   
> > - int mem_cgroup_charge(struct folio *folio, struct mm_struct *mm, gfp_t gfp);
> >  -int __mem_cgroup_charge(struct page *page, struct mm_struct *mm,
> >  -			gfp_t gfp_mask);
> >  -static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm,
> >  -				    gfp_t gfp_mask)
> > ++int __mem_cgroup_charge(struct folio *folio, struct mm_struct *mm, gfp_t gfp);
> > ++static inline int mem_cgroup_charge(struct folio *folio, struct mm_struct *mm,
> > ++				    gfp_t gfp)
> > + {
> > + 	if (mem_cgroup_disabled())
> > + 		return 0;
> >  -	return __mem_cgroup_charge(page, mm, gfp_mask);
> > ++	return __mem_cgroup_charge(folio, mm, gfp);
> > + }
> > + 
> >   int mem_cgroup_swapin_charge_page(struct page *page, struct mm_struct *mm,
> >   				  gfp_t gfp, swp_entry_t entry);
> >   void mem_cgroup_swapin_uncharge_swap(swp_entry_t entry);
> >   
> > - void mem_cgroup_uncharge(struct folio *folio);
> > - void mem_cgroup_uncharge_list(struct list_head *page_list);
> >  -void __mem_cgroup_uncharge(struct page *page);
> >  -static inline void mem_cgroup_uncharge(struct page *page)
> > ++void __mem_cgroup_uncharge(struct folio *folio);
> > ++static inline void mem_cgroup_uncharge(struct folio *folio)
> > + {
> > + 	if (mem_cgroup_disabled())
> > + 		return;
> >  -	__mem_cgroup_uncharge(page);
> > ++	__mem_cgroup_uncharge(folio);
> > + }
> > + 
> > + void __mem_cgroup_uncharge_list(struct list_head *page_list);
> > + static inline void mem_cgroup_uncharge_list(struct list_head *page_list)
> > + {
> > + 	if (mem_cgroup_disabled())
> > + 		return;
> > + 	__mem_cgroup_uncharge_list(page_list);
> > + }
> >   
> >  -void mem_cgroup_migrate(struct page *oldpage, struct page *newpage);
> >  +void mem_cgroup_migrate(struct folio *old, struct folio *new);
> >   
> >   /**
> >    * mem_cgroup_lruvec - get the lru list vector for a memcg & node
> > diff --cc mm/memcontrol.c
> > index 1d77c873463c,c010164172dd..000000000000
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@@ -6712,29 -6718,27 +6708,26 @@@ out
> >   }
> >   
> >   /**
> > -  * mem_cgroup_charge - Charge a newly allocated folio to a cgroup.
> >  - * __mem_cgroup_charge - charge a newly allocated page to a cgroup
> >  - * @page: page to charge
> >  - * @mm: mm context of the victim
> >  - * @gfp_mask: reclaim mode
> > ++ * __mem_cgroup_charge - Charge a newly allocated folio to a cgroup.
> >  + * @folio: Folio to charge.
> >  + * @mm: mm context of the allocating task.
> >  + * @gfp: Reclaim mode.
> >    *
> >  - * Try to charge @page to the memcg that @mm belongs to, reclaiming
> >  - * pages according to @gfp_mask if necessary. if @mm is NULL, try to
> >  + * Try to charge @folio to the memcg that @mm belongs to, reclaiming
> >  + * pages according to @gfp if necessary.  If @mm is NULL, try to
> >    * charge to the active memcg.
> >    *
> >  - * Do not use this for pages allocated for swapin.
> >  + * Do not use this for folios allocated for swapin.
> >    *
> >  - * Returns 0 on success. Otherwise, an error code is returned.
> >  + * Return: 0 on success. Otherwise, an error code is returned.
> >    */
> > - int mem_cgroup_charge(struct folio *folio, struct mm_struct *mm, gfp_t gfp)
> >  -int __mem_cgroup_charge(struct page *page, struct mm_struct *mm,
> >  -			gfp_t gfp_mask)
> > ++int __mem_cgroup_charge(struct folio *folio, struct mm_struct *mm, gfp_t gfp)
> >   {
> >   	struct mem_cgroup *memcg;
> >   	int ret;
> >   
> > - 	if (mem_cgroup_disabled())
> > - 		return 0;
> > - 
> >   	memcg = get_mem_cgroup_from_mm(mm);
> >  -	ret = charge_memcg(page, memcg, gfp_mask);
> >  +	ret = charge_memcg(folio, memcg, gfp);
> >   	css_put(&memcg->css);
> >   
> >   	return ret;
> > @@@ -6906,20 -6909,17 +6899,17 @@@ static void uncharge_folio(struct foli
> >   }
> >   
> >   /**
> > -  * mem_cgroup_uncharge - Uncharge a folio.
> >  - * __mem_cgroup_uncharge - uncharge a page
> >  - * @page: page to uncharge
> > ++ * __mem_cgroup_uncharge - Uncharge a folio.
> >  + * @folio: Folio to uncharge.
> >    *
> >  - * Uncharge a page previously charged with __mem_cgroup_charge().
> >  + * Uncharge a folio previously charged with mem_cgroup_charge().
> >    */
> > - void mem_cgroup_uncharge(struct folio *folio)
> >  -void __mem_cgroup_uncharge(struct page *page)
> > ++void __mem_cgroup_uncharge(struct folio *folio)
> >   {
> >   	struct uncharge_gather ug;
> >   
> > - 	if (mem_cgroup_disabled())
> > - 		return;
> > - 
> >  -	/* Don't touch page->lru of any random page, pre-check: */
> >  -	if (!page_memcg(page))
> >  +	/* Don't touch folio->lru of any random page, pre-check: */
> >  +	if (!folio_memcg(folio))
> >   		return;
> >   
> >   	uncharge_gather_clear(&ug);
> > @@@ -6932,19 -6932,16 +6922,16 @@@
> >    * @page_list: list of pages to uncharge
> >    *
> >    * Uncharge a list of pages previously charged with
> > -  * mem_cgroup_charge().
> > +  * __mem_cgroup_charge().
> >    */
> > - void mem_cgroup_uncharge_list(struct list_head *page_list)
> > + void __mem_cgroup_uncharge_list(struct list_head *page_list)
> >   {
> >   	struct uncharge_gather ug;
> >  -	struct page *page;
> >  +	struct folio *folio;
> >   
> > - 	if (mem_cgroup_disabled())
> > - 		return;
> > - 
> >   	uncharge_gather_clear(&ug);
> >  -	list_for_each_entry(page, page_list, lru)
> >  -		uncharge_page(page, &ug);
> >  +	list_for_each_entry(folio, page_list, lru)
> >  +		uncharge_folio(folio, &ug);
> >   	if (ug.memcg)
> >   		uncharge_batch(&ug);
> >   }
> 
> This is now a conflict between the folio tree and Linus' tree.

Quite.  Linus, how do you want to handle this?  Pull the folio-5.15 tag
I originally sent you?  Pull the pageset-5.15 tag?  Tell me you'll never
accept this and drop the entire idea?

Do you need anything from me?

  reply	other threads:[~2021-09-06 12:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  6:31 linux-next: manual merge of the akpm-current tree with the folio tree Stephen Rothwell
2021-09-06  4:48 ` Stephen Rothwell
2021-09-06 12:12   ` Matthew Wilcox [this message]
2021-09-06 16:56     ` Suren Baghdasaryan
2021-09-06 21:35       ` Stephen Rothwell
2021-09-07 13:49   ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2022-04-08  5:18 Stephen Rothwell
2022-04-08  5:08 Stephen Rothwell
2022-03-22  8:35 Stephen Rothwell
2022-02-16  6:15 Stephen Rothwell
2022-02-15  7:00 Stephen Rothwell
2022-02-15 13:12 ` Matthew Wilcox
2022-02-16  6:21   ` Stephen Rothwell
2022-02-16  9:49     ` Stephen Rothwell
2022-02-16 20:41     ` Matthew Wilcox
2022-02-17  5:30       ` Stephen Rothwell
2022-02-17  5:51         ` Andrew Morton
2022-02-17  6:38           ` Stephen Rothwell
2022-02-17 21:19             ` Matthew Wilcox
2022-02-19  7:27               ` Christoph Hellwig
2022-02-20  0:17               ` Stephen Rothwell
2021-12-10 21:17 broonie
2021-07-21  6:02 Stephen Rothwell
2021-09-06  4:49 ` Stephen Rothwell

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=YTYFm1Ca8LHvrlyq@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=surenb@google.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;
as well as URLs for NNTP newsgroup(s).