linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "link@vivo.com" <link@vivo.com>
To: willy <willy@infradead.org>
Cc: akpm <akpm@linux-foundation.org>,
	 kirill.shutemov <kirill.shutemov@linux.intel.com>,
	 william.kucharski <william.kucharski@oracle.com>,
	 linux-kernel <linux-kernel@vger.kernel.org>,
	 linux-mm <linux-mm@kvack.org>,  kernel <kernel@vivo.com>,
	 wangqing <wangqing@vivo.com>
Subject: Re: Re: [PATCH] mm/page_alloc: enable alloc bulk when page owner is on
Date: Sat, 17 Jul 2021 11:03:24 +0800	[thread overview]
Message-ID: <2021071711032416263511@vivo.com> (raw)
In-Reply-To: <AI6A1gAJD1YuOGo4nTT21Ko0.1.1626487348736.Hmail.link@vivo.com>



>



>



>>> Last alloc bulk version have a bug, when page_owner is on, system maybe



>>> crashed due to alloc bulk invoke prep_new_page in irq disabled context,



>>> and set_page_owner use page_flag(may GFP_KERNEL) to get memory and save



>>> stacktrace.



>>> We fix it by a circumvention plan -- bandon alloc bulk feature when



>>> page_owner is set.



>>> I think both alloc_bulk and page_owner is valuable, so, it's worth to



>>> find a way enable alloc bulk when page owner is on.



>>



>>Why do you think it's valuable?  The point of alloc_bulk is speed.

And ok. if you think in debug version use alloc bulk is not valuable.
But I think alloc buk used prep_new_page's way reflect that debug
feature shouldn't assume they can used the same way to get memory,
just like the page it traced.
If we not give debugger some info(alloc_gfp), they have no way, but
to use page's gfp to get memory.(alloc bulk show it's wrong.)

For now, only PAGE_OWNER get memory in prep_new_page, for future,
may have more feature need memory. 
And may have more feature invoke prep_new_page in different context
to the page.

So, give a alloc_gfp to lead debugger to alloc memory is valuable.



>>Doing the allocation of a stack for each page removes the speed.



>



>>Where's the value?



>Without alloc bulk, we also need to alloc pages from loop invoke



>alloc_page, and this also will invoke set_page_owner to save stack.



>So, find a way to let alloc_bulk work, I think is valuable.



>If you don't think so, I sorry for my disturb.



>



>>If you're really interested in making both these things work together,



>>then I observed that all of these pages are going to have the same



>>allocation stack.  Allocating that stack once per call to alloc_bulk,



>>reference counting it and having each page use the shared stack would 



>



>>be a good way of combining the two (it'd even save memory!)



>Yes, your idea is very good.



>



>But, how we let set_page_owner knew that recent pages are all in same stack?



>Maybe save stack by caller, and passed handle in prep_new_page?



>But, I think caller shouldn't care of page trace, it's page owner feature's duties.



>Let same stack's page have same magic number maybe a good way, emm



>But, even they have same stack, set_page_owner should know how to get memory



>rightly (Unless you pass it to, so back to the duties).



>In the past, we just pass page gfp to it, in alloc bulk, not right.



>



>>This patch, I think, does not make sense.



>Well, this is a simple way that I can find, and not affect perfermance both in normal and



>PAGE_OWNER is on, but can work alloc bulk and PAGE_OWNER. 



>If you don't think so,  I'm sorry for that



>



>



      reply	other threads:[~2021-07-17  3:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17  2:02 杨欢
2021-07-17  3:03 ` link [this message]

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=2021071711032416263511@vivo.com \
    --to=link@vivo.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@vivo.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=wangqing@vivo.com \
    --cc=william.kucharski@oracle.com \
    --cc=willy@infradead.org \
    /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