From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id AA5918E0038 for ; Thu, 10 Jan 2019 05:08:54 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id c34so4101618edb.8 for ; Thu, 10 Jan 2019 02:08:54 -0800 (PST) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id t3-v6si2359215ejx.136.2019.01.10.02.08.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 02:08:53 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 10 Jan 2019 11:08:52 +0100 From: Roman Penyaev Subject: Re: [RFC PATCH 03/15] mm/vmalloc: introduce new vrealloc() call and its subsidiary reach analog In-Reply-To: <20190109165009.GM6310@bombadil.infradead.org> References: <20190109164025.24554-1-rpenyaev@suse.de> <20190109164025.24554-4-rpenyaev@suse.de> <20190109165009.GM6310@bombadil.infradead.org> Message-ID: Sender: owner-linux-mm@kvack.org List-ID: To: Matthew Wilcox Cc: Andrew Morton , Michal Hocko , Andrey Ryabinin , Joe Perches , "Luis R. Rodriguez" , linux-mm@kvack.org, linux-kernel@vger.kernel.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