linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Chintan Pandya <chintan.pandya@oneplus.com>
Cc: Alexander Duyck <alexander.duyck@gmail.com>,
	Prathu Baronia <prathu.baronia@oneplus.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"gthelen@google.com" <gthelen@google.com>,
	"jack@suse.cz" <jack@suse.cz>, Michal Hocko <mhocko@suse.com>,
	Ken Lin <ken.lin@oneplus.com>, Gasine Xu <Gasine.Xu@oneplus.com>
Subject: Re: [RFC] mm/memory.c: Optimizing THP zeroing routine for !HIGHMEM cases
Date: Tue, 14 Apr 2020 11:55:25 -0400	[thread overview]
Message-ID: <20200414155525.6s5wlsdiktocs3c3@ca-dmjordan1.us.oracle.com> (raw)
In-Reply-To: <SG2PR04MB292105458BE292DD1882B43291DF0@SG2PR04MB2921.apcprd04.prod.outlook.com>

On Sat, Apr 11, 2020 at 08:45:35AM +0000, Chintan Pandya wrote:
> > > +#else
> > > +void clear_huge_page(struct page *page,
> > > +                    unsigned long addr_hint, unsigned int
> > > +pages_per_huge_page) {
> > > +       void *addr;
> > > +
> > > +       addr = page_address(page);
> > > +       memset(addr, 0, pages_per_huge_page*PAGE_SIZE); } #endif
> > 
> > This seems like a very simplistic solution to the problem, and I am worried
> > something like this would introduce latency issues when pages_per_huge_page
> > gets to be large. It might make more sense to just wrap the process_huge_page
> > call in the original clear_huge_page and then add this code block as an #else
> > case. That way you avoid potentially stalling a system for extended periods of
> > time if you start trying to clear 1G pages with the function.
> > 
> > One interesting data point would be to see what the cost is for breaking this up
> > into a loop where you only process some fixed number of pages and running it
> > with cond_resched() so you can avoid introducing latency spikes.
> 
> As per the patch above, it's not using kmap_atomic() and hence preemption & page_fault
> are not disabled. Do we still need to explicitly call cond_resched() in this case?
> #justAsking

Didn't see this answered on the list, but the answer is yes because the kernel
may not have CONFIG_PREEMPTION enabled.


  reply	other threads:[~2020-04-14 15:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03  8:18 Prathu Baronia
2020-04-03  8:52 ` Michal Hocko
2020-04-09 15:29   ` Prathu Baronia
2020-04-09 15:45     ` Michal Hocko
     [not found]       ` <SG2PR04MB2921D2AAA8726318EF53D83691DE0@SG2PR04MB2921.apcprd04.prod.outlook.com>
2020-04-10  9:05         ` Huang, Ying
2020-04-11 15:40           ` Chintan Pandya
2020-04-11 20:47             ` Alexander Duyck
2020-04-13 15:33               ` Prathu Baronia
2020-04-13 16:24                 ` Alexander Duyck
2020-04-14  1:10                 ` Huang, Ying
2020-04-10 18:54 ` Alexander Duyck
2020-04-11  8:45   ` Chintan Pandya
2020-04-14 15:55     ` Daniel Jordan [this message]
2020-04-14 17:33       ` Chintan Pandya

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=20200414155525.6s5wlsdiktocs3c3@ca-dmjordan1.us.oracle.com \
    --to=daniel.m.jordan@oracle.com \
    --cc=Gasine.Xu@oneplus.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.duyck@gmail.com \
    --cc=chintan.pandya@oneplus.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gthelen@google.com \
    --cc=jack@suse.cz \
    --cc=ken.lin@oneplus.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=prathu.baronia@oneplus.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