Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3008175pxb; Mon, 6 Sep 2021 10:08:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfa3ncQZtkA5DSOEv0YZ+A/Y8mC9zK6d2Lejm2VegRrf/zhL0wNST0QhWtvsC1NnbmVOTB X-Received: by 2002:a17:907:75d0:: with SMTP id jl16mr14420680ejc.166.1630948129145; Mon, 06 Sep 2021 10:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630948129; cv=none; d=google.com; s=arc-20160816; b=SdEU/wfdP10iq/vrWM4xsWoTkSaRr6BDbCVXYgCMUfgHCWLJcaFrP7qMxjVbR5aDmL HbqBwELE+zS3b1YL5unSH+3VJAccBrizymEeyyM+nx3HkaT+0npZIG7u6rYuO1Y3MMuM ouVy9vU5mYj3o4bg6XXFLcJVnHFTb2gkgdESn6asEcIQC8FxVgkKbjq+cxbh/kpDmwp5 IK+GA4aXET7yiozLMfI1y/QG/j/VqdvB3k76V1uv9cKsAinmAJEFvR4KoNlc5PhYxDTV bM8N4kuLduqSYJyjI9H0gUigrj6mzhpbk2Dul9lLqu/iSy1d5xi1nZgmvnxm7KC1wXO7 oeFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XaMF+DeLAjg4NOrcNx5yKPhZDgSxDgd2/NGyTr3E1P4=; b=FbInB9qjdRqM4WTb4JpDc+2lPIjyljQgG/afw7PyzUqXHApzO/3kQciTnQrzOcQrFF uEhERg9xzkl7q2Qf9bue1gK9j/ezBdKoiuH6z7su5dwDrFbdzBd5Lfd4azoXxXnXR4XS sICnYbmJhSO/4gjmXybsVC6fEKfo8BzojAYl26+dnYC4rPpB1iwRgJhzlLF/2r4UWWSl DnJNkXi5CTHvxwtAokRXsfA7HTneUYOp6MGz5E+2OBDep+uxcGofl228L/ugFE4RZSde 17sy8flXlK1BiUkYVxm2LuLvJ5Kd9PrtXljO13RcD7YmLs8vU96g0WOXucxbfeevpCD+ B9Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Llal/g9i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si9524925ejw.120.2021.09.06.10.08.25; Mon, 06 Sep 2021 10:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="Llal/g9i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240870AbhIFQ5c (ORCPT + 99 others); Mon, 6 Sep 2021 12:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhIFQ5b (ORCPT ); Mon, 6 Sep 2021 12:57:31 -0400 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDD5CC061575 for ; Mon, 6 Sep 2021 09:56:26 -0700 (PDT) Received: by mail-yb1-xb2d.google.com with SMTP id q70so14595880ybg.11 for ; Mon, 06 Sep 2021 09:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XaMF+DeLAjg4NOrcNx5yKPhZDgSxDgd2/NGyTr3E1P4=; b=Llal/g9ih9jcfAn1nHXt0VNfp+ge5evVfSFn2twpLi2vi9wYj0HbCpsEaZx1aAaLUU Wza2SZtDDb8NcCpBHTSlu5M+0CCV9hKiYkkcCLuvM32fj+nEGcK01fYR1x8eT/1BLB3D tp+axTLJKDQEfQGDFR5I6mX4CvhA55Rufp4PU1iAWRppqolsiY3fbYA2Lf/Fav97JFdH LfARqle14EW/A9wnFfT5nLm7ffJrzfLj5zLN2bxAFYZ/xtN2QNwFbTe1H8GqIrpX17Pm uAc1uRSYBSMLMgQGjOi1fJTuhVEeIO2n3gARYBMKTI0QTBvriXz9h5St2HFMQK0qjEot hUIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XaMF+DeLAjg4NOrcNx5yKPhZDgSxDgd2/NGyTr3E1P4=; b=g0NtrIJ2hcL1dK6MyvQXIUsf/foanG8MoY3XTsGZQC0wkdCi061p9Ox8OeZbQtKVnu 6M7nOpdaYXZVv3zqO1g5KWDudihDKTT+fMIxYgs75dGjtARWh/JtymtDFr8+x4KgusCy vyHnvbTkWaaCYGFtQTkatqtkcTEI1oA/UcOxuvsA/s8b4GBYzJhzdfnB/6TdtzGiU5nG I6bH7yEBjut/Q0GSSeYaPb3qKgpTJFOcxtoS5ybOgVPvh2/KswCcabgo/NyZb3vXzmfJ QwCkgMI87KUlI/q/Kw2k2i5NhnESbvRpgkulTQ/HFkBFBbJwg1ydVwQXW/b984pIcFz5 AFVg== X-Gm-Message-State: AOAM530er8aRnpGTj8ki5tKGo9sICN5LO90ZonWjF+OqnP0Db+JjvxL2 hmg0T09D1msJGZHqLSww/SyXQbdVaKcFZroOCXoc8TFcXuZJlQ== X-Received: by 2002:a25:5686:: with SMTP id k128mr18302185ybb.127.1630947385793; Mon, 06 Sep 2021 09:56:25 -0700 (PDT) MIME-Version: 1.0 References: <20210721163118.3ca01b57@canb.auug.org.au> <20210906144807.4db0790f@canb.auug.org.au> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 6 Sep 2021 09:56:14 -0700 Message-ID: Subject: Re: linux-next: manual merge of the akpm-current tree with the folio tree To: Matthew Wilcox Cc: Stephen Rothwell , Andrew Morton , Linux Kernel Mailing List , Linux Next Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 6, 2021 at 5:13 AM Matthew Wilcox wrote: > > 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 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? If dropping my patch (1f4c6a1cf274 ("mm, memcg: inline mem_cgroup_{charge/uncharge} to improve disabled memcg config")) helps in resolving this, feel free to do that and I'll redo it after folios are merged. Thanks, Suren.