linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: hui yang <yanghui.def@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm page_fault: Reduce code complexity
Date: Thu, 28 May 2020 04:45:15 -0700	[thread overview]
Message-ID: <20200528114515.GO17206@bombadil.infradead.org> (raw)
In-Reply-To: <1590663699-4541-1-git-send-email-yanghui.def@gmail.com>

On Thu, May 28, 2020 at 07:01:39PM +0800, hui yang wrote:
> From: YangHui <yanghui.def@gmail.com>
> 
> if pte_alloc_one failed alloc a page, do_fault_around will return 0.
> and it will come into __do_fault(), it also pte_alloc_one a page.
> in __do_fault and do_fault_around, pte_alloc_one did the same thing,
> if do_fault_around alloc page filed,we just let it return. there is
> no need to come into __do_fault to do repetitive pte_alloc_one.

This really isn't "Reduce code complexity" though.  It's "Fail early
when memory allocation fails".  And, honestly, I don't see the point
of doing this.  You've optimised an incredibly rare failure path.


      reply	other threads:[~2020-05-28 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 11:01 [PATCH] mm page_fault: Reduce code complexity hui yang
2020-05-28 11:45 ` Matthew Wilcox [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=20200528114515.GO17206@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=yanghui.def@gmail.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).