From: Roman Penyaev <rpenyaev@suse.de>
To: Matthew Wilcox <willy@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Michal Hocko <mhocko@suse.com>,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Joe Perches <joe@perches.com>,
"Luis R. Rodriguez" <mcgrof@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 03/15] mm/vmalloc: introduce new vrealloc() call and its subsidiary reach analog
Date: Thu, 10 Jan 2019 11:08:52 +0100 [thread overview]
Message-ID: <f9ee08f81b3c114b015643e1fca5b7a9@suse.de> (raw)
In-Reply-To: <20190109165009.GM6310@bombadil.infradead.org>
On 2019-01-09 17:50, Matthew Wilcox wrote:
> On Wed, Jan 09, 2019 at 05:40:13PM +0100, Roman Penyaev wrote:
>> Basically vrealloc() repeats glibc realloc() with only one big
>> difference:
>> old area is not freed, i.e. caller is responsible for calling vfree()
>> in
>> case of successfull reallocation.
>
> Ouch. Don't call it the same thing when you're providing such
> different
> semantics. I agree with you that the new semantics are useful ones,
> I just want it called something else. Maybe vcopy()? vclone()?
vclone(). I like vclone(). But Linus does not like this reallocation
under the hood for epoll (where this vrealloc() should have been used),
so seems that won't be needed at all.
>
>> + * Do not forget to call vfree() passing old address. But careful,
>> + * calling vfree() from interrupt will cause vfree_deferred() call,
>> + * which in its turn uses freed address as a temporal pointer for a
>
> "temporary", not temporal.
Ha! Now I got the difference. Thanks, Mathew :)
>
>> + * llist element, i.e. memory will be corrupted.
--
Roman
prev parent reply other threads:[~2019-01-10 10:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-09 16:40 [RFC 00/15] epoll: support pollable epoll from userspace Roman Penyaev
2019-01-09 16:40 ` Roman Penyaev
2019-01-09 16:40 ` [RFC PATCH 01/15] mm/vmalloc: add new 'alignment' field for vm_struct structure Roman Penyaev
2019-01-09 16:40 ` Roman Penyaev
2019-01-09 16:40 ` [RFC PATCH 02/15] mm/vmalloc: move common logic from __vmalloc_area_node to a separate func Roman Penyaev
2019-01-09 16:40 ` Roman Penyaev
2019-01-09 16:40 ` [RFC PATCH 03/15] mm/vmalloc: introduce new vrealloc() call and its subsidiary reach analog Roman Penyaev
2019-01-09 16:40 ` Roman Penyaev
2019-01-09 16:50 ` Matthew Wilcox
2019-01-10 10:08 ` Roman Penyaev [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=f9ee08f81b3c114b015643e1fca5b7a9@suse.de \
--to=rpenyaev@suse.de \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=mhocko@suse.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