Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp781090pxf; Thu, 18 Mar 2021 11:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbsR3wwadY6tJQcpbhYZEXBKpmhYtjnSPuaKcuspePdfmNP1G83U+uoES+14Ejg+YumxY1 X-Received: by 2002:aa7:c6da:: with SMTP id b26mr5361224eds.254.1616091680917; Thu, 18 Mar 2021 11:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616091680; cv=none; d=google.com; s=arc-20160816; b=SbLOB+lJlHF2/fah0PKIj3G2FcppD15CCGFW1rY+Za0NG2G8wfDgxMD1DZJkNJzyW9 rEfkyxmFwsUvrfNcDv+HkwJcvlaMWgFfyJkLZxblQE183CIHSpxgiD+zKPdPcsBzaZ8o RZYy1q7IQN0DIk1e7le2TK4lk6a8NtpduTlbfteNGcnWUJSnJeScVgLqIf2ujJ7glIsH uGEdwJAUpvR+n+ETbKw8r+7GlWajBcnQBWYNn3uY1lgeNMbhNDMrC/8HpxcKouuhQmG5 Sev3Gc6T552+2BF2K5Y5VrVxSZLpV6eUr9U1quHV0SvJIYbZmyo2btS2Hdn1zDlX9ciJ cNUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=oF3ZUW+4J4CFMM7Juvx/eFO+KnFrLTNl0x25bnTL6cQ=; b=IKwBwyUl9ayRFSEeGoNecg2hlR3/HZSbvV9xGpLtThsbH5bDRndUQIZK6jzC/Fs5Cf 50TxQrw2Rks3+di04IC6E2Wq0luYwEcgpt0vr2p7iNnTlKVzTIoVLnAlnaJKDcXR/CM8 3y/aQqxBbo6Gi4zlPCOHHIyZp1ObxaUjm/rejtIzLYs7ZvsDKnWJRS4O+YlZKpPA3+a+ RqzDU5AUUay7LQo3l2kn9hIQqPBbRAegrL12yjNNozBUoMCHIoYjzmraLpGTcGlCqFqe lyoVZdViOgNfHuKUijnpkvLvWBLPgU/1/sjzLcWAfyTGYPhFmM0KyS5I3btyWNK5kmae /k7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=EjKtEX+x; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf1si2107995edb.359.2021.03.18.11.20.57; Thu, 18 Mar 2021 11:21:20 -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=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=EjKtEX+x; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230442AbhCRSUA (ORCPT + 99 others); Thu, 18 Mar 2021 14:20:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbhCRSTg (ORCPT ); Thu, 18 Mar 2021 14:19:36 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21126C06174A for ; Thu, 18 Mar 2021 11:19:36 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id k8so3295245iop.12 for ; Thu, 18 Mar 2021 11:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oF3ZUW+4J4CFMM7Juvx/eFO+KnFrLTNl0x25bnTL6cQ=; b=EjKtEX+xFlBYcUVGMVT8rDwEhj+phbsFS6yb9jT0W1rNTmGl7m4hzLIFB+ujjzOuep QMNrs5fzUu9QW4WbkVeBfQNn96h6bp9MG9KaCtxQp4mbcsmkaAGy/Xpd4VejZ7PBddnB 52lif8yrBnZuR9b/AjAr4iH7DW6+ClccQhcI+2ZbH6dqg4drBT7tRkdRYTmVAtdosdPe 0UK7zQqsOrSxq3bXNYWVbogZWDCSDFo4S3fPgvkkDfgwqff+iEor6CA8DAjG2RMfV99n 0rkkr7E/loriLElLmTLdpLy4T+9emJ3EGWvu/ZwjgQ8yudsi+eNASx2Xd8t82bzmC1Mj r2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oF3ZUW+4J4CFMM7Juvx/eFO+KnFrLTNl0x25bnTL6cQ=; b=oEMNqJVZXTUeYeFQGmJA/TVXpzCUsiFf3YsZ9b1wJqWGrN3+xZo/FUeaurt3AsSYUl LaIsw4a5to6ZSR0X/lQgfFUqDMq+t2PAyUoKvAAYXjXxCqBj76eZqHZHBInGwjs9RE+K qsIg2tnrBY9e3sRxQ5/3POCDsAoiiJpTfdd9TtN1MTRViJ/bvZ3nXxxjcmqNjuK9wbGu R00p+KUyU7gpQnPUqQ5CeRGkI0tC/Lp/8ZScmLpMbvKYqJAnP0nGHQr7by0kLHbDYyX9 zR9tguqXodMpOkJQwzt9S177SsTbHSg+rzq0aH84gXGLnibKnY/xuKqVnTawCIplU0uK D1Sg== X-Gm-Message-State: AOAM533UANS5ZoCNPxwbBIV8cBZbrlHK0rpyXX7geGKbzXx7naDN7kN7 53G1bbOQOJMPjBQ9nMnj5UBLWQ== X-Received: by 2002:a02:9985:: with SMTP id a5mr7980431jal.122.1616091575551; Thu, 18 Mar 2021 11:19:35 -0700 (PDT) Received: from [192.168.1.30] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id q12sm668404ilm.63.2021.03.18.11.19.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Mar 2021 11:19:35 -0700 (PDT) Subject: Re: linux-next: manual merge of the akpm-current tree with the block tree To: Shakeel Butt , Stephen Rothwell Cc: Andrew Morton , Dan Schatzberg , Linux Kernel Mailing List , Linux Next Mailing List References: <20210318171720.61a3f59c@canb.auug.org.au> From: Jens Axboe Message-ID: <4fea89a5-0e18-0791-18a8-4c5907b0d2c4@kernel.dk> Date: Thu, 18 Mar 2021 12:19:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/21 11:54 AM, Shakeel Butt wrote: > On Wed, Mar 17, 2021 at 11:17 PM Stephen Rothwell wrote: >> >> Hi all, >> >> Today's linux-next merge of the akpm-current tree got a conflict in: >> >> mm/memcontrol.c >> >> between commit: >> >> 06d69d4c8669 ("mm: Charge active memcg when no mm is set") >> >> from the block tree and commit: >> >> 674788258a66 ("memcg: charge before adding to swapcache on swapin") >> >> from the akpm-current tree. >> >> I fixed it up (I think - 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. >> >> -- >> Cheers, >> Stephen Rothwell >> >> diff --cc mm/memcontrol.c >> index f05501669e29,668d1d7c2645..000000000000 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@@ -6691,65 -6549,73 +6550,80 @@@ out >> * @gfp_mask: reclaim mode >> * >> * Try to charge @page to the memcg that @mm belongs to, reclaiming >> - * pages according to @gfp_mask if necessary. >> + * pages according to @gfp_mask if necessary. if @mm is NULL, try to >> + * charge to the active memcg. >> * >> + * Do not use this for pages allocated for swapin. >> + * >> * Returns 0 on success. Otherwise, an error code is returned. >> */ >> int mem_cgroup_charge(struct page *page, struct mm_struct *mm, gfp_t gfp_mask) >> { >> - unsigned int nr_pages = thp_nr_pages(page); >> - struct mem_cgroup *memcg = NULL; >> - int ret = 0; >> + struct mem_cgroup *memcg; >> + int ret; >> >> if (mem_cgroup_disabled()) >> - goto out; >> + return 0; >> >> - if (PageSwapCache(page)) { >> - swp_entry_t ent = { .val = page_private(page), }; >> - unsigned short id; >> - memcg = get_mem_cgroup_from_mm(mm); >> ++ if (!mm) { >> ++ memcg = get_mem_cgroup_from_current(); >> ++ if (!memcg) >> ++ memcg = get_mem_cgroup_from_mm(current->mm); >> ++ } else { >> ++ memcg = get_mem_cgroup_from_mm(mm); >> ++ } >> + ret = __mem_cgroup_charge(page, memcg, gfp_mask); >> + css_put(&memcg->css); > > Things are more complicated than this. First we need a similar change > in mem_cgroup_swapin_charge_page() but I am thinking of making > get_mem_cgroup_from_mm() more general and not make any changes in > these two functions. > > Is it possible to get Dan's patch series in mm tree? More specifically > the above two patches in the same tree then one of us can make their > patch rebase over the other (I am fine with doing this myself). Yes, I think we should do that, and since he's going to be respinning the series anyway, I'll drop it right now and then let's take it through Andrew to avoid unnecessary complications that way. -- Jens Axboe