linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Shakeel Butt <shakeelb@google.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dan Schatzberg <schatzberg.dan@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: Re: linux-next: manual merge of the akpm-current tree with the block tree
Date: Thu, 18 Mar 2021 12:19:34 -0600	[thread overview]
Message-ID: <4fea89a5-0e18-0791-18a8-4c5907b0d2c4@kernel.dk> (raw)
In-Reply-To: <CALvZod7iPJ1h0MVpBwNkqJBfNNWPb+x93q59okdK5oxevzbP_g@mail.gmail.com>

On 3/18/21 11:54 AM, Shakeel Butt wrote:
> On Wed, Mar 17, 2021 at 11:17 PM Stephen Rothwell <sfr@canb.auug.org.au> 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


  reply	other threads:[~2021-03-18 18:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  6:17 linux-next: manual merge of the akpm-current tree with the block tree Stephen Rothwell
2021-03-18 17:54 ` Shakeel Butt
2021-03-18 18:19   ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-06-02  5:40 Stephen Rothwell
2021-04-07  9:18 Stephen Rothwell
2020-11-17  5:05 Stephen Rothwell
2020-10-15  6:27 Stephen Rothwell
2020-09-25  9:57 Stephen Rothwell
2019-05-03  9:10 Stephen Rothwell
2019-05-03 12:35 ` Amir Goldstein
2018-10-02  7:21 Stephen Rothwell
2018-08-13  7:51 Stephen Rothwell
2018-08-02  8:31 Stephen Rothwell
2018-03-19  6:36 Stephen Rothwell
2016-07-13  6:14 Stephen Rothwell
2016-07-13 16:31 ` Jens Axboe
2015-12-07  8:12 Stephen Rothwell
2015-12-07 19:44 ` Andrew Morton
2015-12-07 20:24   ` Stephen Rothwell
2015-11-01 15:51 Stephen Rothwell
2015-11-01 16:04 ` kbuild test robot
2015-11-01 16:05 ` kbuild test robot
2015-11-01 18:38 ` Mel Gorman
2015-11-01 21:51   ` Stephen Rothwell
2015-01-21  7:14 Stephen Rothwell
2014-07-02  6:06 Stephen Rothwell
2013-11-05  6:29 Stephen Rothwell
2013-11-05  6:25 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=4fea89a5-0e18-0791-18a8-4c5907b0d2c4@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=schatzberg.dan@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=shakeelb@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).