From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47BA4C433E6 for ; Thu, 18 Mar 2021 18:20:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED49964F53 for ; Thu, 18 Mar 2021 18:20:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbhCRSUA (ORCPT ); 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-Google-Smtp-Source: ABdhPJz+KCRumbxLMPvmy0nP13iuFKiNw7uhLGiA2Css6rHPzUMn9LXLwG8nVd8PUVJAPFxFd841Qw== 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