mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/gup.c: Handle error at earliest for incorrect nr_pages value
Date: Thu, 30 Apr 2020 14:23:11 -0700	[thread overview]
Message-ID: <20200430142311.091b82235141ca47b9c6475a@linux-foundation.org> (raw)
In-Reply-To: <1588277518-21425-1-git-send-email-jrdr.linux@gmail.com>

On Fri,  1 May 2020 01:41:58 +0530 Souptick Joarder <jrdr.linux@gmail.com> wrote:

> As per documentation, pin_user_pages_fast() & get_user_pages_fast()
> will return 0, if nr_pages <= 0. But this can be figure out only after
> going inside the internal_get_user_pages_fast().
> 
> This can be handled early. Adding a check for the same.

Calling get_user_pages() for (nrpages <= 0) is a nonsensical thing to
do so it isn't a thing we should care to optimize.  Adding new checks
will actually slow down the use cases which we *do* care about.  And it
adds more code.


  reply	other threads:[~2020-04-30 21:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 20:11 Souptick Joarder
2020-04-30 21:23 ` Andrew Morton [this message]
2020-04-30 21:24 ` Ira Weiny
2020-05-01 21:16   ` Souptick Joarder
2020-05-01 21:33 ` John Hubbard
2020-05-01 21:46   ` Souptick Joarder

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=20200430142311.091b82235141ca47b9c6475a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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

all inboxes | Powered by JetHome®