From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Roman Penyaev <rpenyaev@suse.de>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Rick Edgecombe <rick.p.edgecombe@intel.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Mike Rapoport <rppt@linux.ibm.com>, Roman Gushchin <guro@fb.com>,
Michal Hocko <mhocko@suse.com>,
"Uladzislau Rezki (Sony)" <urezki@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/vmalloc: Check absolute error return from vmap_[p4d|pud|pmd|pte]_range()
Date: Thu, 13 Jun 2019 20:51:17 +0530 [thread overview]
Message-ID: <406afc57-5a77-a77c-7f71-df1e6837dae1@arm.com> (raw)
In-Reply-To: <7cc6a46c50c2008bfb968c5e48af5a49@suse.de>
On 06/13/2019 03:03 PM, Roman Penyaev wrote:
> On 2019-06-13 10:12, Anshuman Khandual wrote:
>> vmap_pte_range() returns an -EBUSY when it encounters a non-empty PTE. But
>> currently vmap_pmd_range() unifies both -EBUSY and -ENOMEM return code as
>> -ENOMEM and send it up the call chain which is wrong. Interestingly enough
>> vmap_page_range_noflush() tests for the absolute error return value from
>> vmap_p4d_range() but it does not help because -EBUSY has been merged with
>> -ENOMEM. So all it can return is -ENOMEM. Fix this by testing for absolute
>> error return from vmap_pmd_range() all the way up to vmap_p4d_range().
>
> I could not find any real external caller of vmap API who really cares
> about the errno, and frankly why they should? This is allocation path,
map_vm_area() which is an exported symbol suppose to provide the right
error code regardless whether it's current users care for it or not.
> allocation failed - game over. When you step on -EBUSY case something
> has gone completely wrong in your kernel, you get a big warning in
> your dmesg and it is already does not matter what errno you get.
Its true that vmap_pte_range() does warn during error conditions. But if
we really dont care about error return code then we should just remove
specific error details (ENOMEM/EBUSY) and instead replace them with simple
boolean false/true or (0/1/-1) return values at each level. Will that be
acceptable ? What we have currently is wrong where vmap_pmd_range() could
just wrap EBUSY as ENOMEM and send up the call chain.
next prev parent reply other threads:[~2019-06-13 15:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 8:12 Anshuman Khandual
2019-06-13 9:33 ` Roman Penyaev
2019-06-13 15:21 ` Anshuman Khandual [this message]
2019-06-13 15:31 ` Matthew Wilcox
2019-06-14 5:27 ` Anshuman Khandual
2019-06-14 13:42 ` Matthew Wilcox
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=406afc57-5a77-a77c-7f71-df1e6837dae1@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=guro@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rick.p.edgecombe@intel.com \
--cc=rpenyaev@suse.de \
--cc=rppt@linux.ibm.com \
--cc=urezki@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