Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1744519imu; Thu, 10 Jan 2019 02:13:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN7RSW8XDv5l/i+FPiglNZtUjYwo+QToI6eKo3c9chM1Myeqp9YLVJ4wJH3MFKQOdDa6Kaxr X-Received: by 2002:a63:6984:: with SMTP id e126mr8927367pgc.143.1547115214785; Thu, 10 Jan 2019 02:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547115214; cv=none; d=google.com; s=arc-20160816; b=pcutThIbuJm7HNwZ1cXJ3UF9eVR1/IuT2xe2mzx1q6gflGm8+9NXoBjhga0OlQx8Js Lqk17L/50n3e+DSQc9u7+vHaCCzF+FrfdwSGi5McpOFxYtoCWyyZnZrBI0dmf385s/KP fXzpWX8nk6uLrgSndgVm+KqtDHifznyg9tLya/FswgP+mETiqMAp4WDfORjl+ZcXN0Dg JKm6txFFn5G/MIb3AKvtlRyoKgn3ifMLYiPyVygHwv19azjaaqFdXLu+IV5hpHwEJS3P 6bJxJ9wQJZWUhS6llten8yXs1xQBysi06QFRXiSk/OBvy853QyLMB+V4p9/i6QZQJETf MsRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=gZlJZdNIY11Ye1nqewZXf/0icROZT831Wm6FIXjzOMM=; b=bJlfGO/+r/QJnizPmLjkA4ZU4JM/6MDv4MiW60rldIZDOD8XfI8yVUSTN/8SUA5ODZ WODz6u1AnNinUy97B0EgScHJYCLQEpueyR6Ep3+oCyQscJQcECfKpxZrYkoTU2AAf4JG TwgymDbLgfFdoDIERKTWiJsCgHo3qO2cH/p88yb69Cn/AJ6VeKjyxFinv+jPxVvRG5Cj k3nwvPanw4QuCZ1zJgSSnv12cD5uQiyL9gxADerLZr2DNm2gNIjhee/bRf7sh9mpFMpL xqXiqZuxb4zlB5y9QdQUbIrhl67kg5UP7G9EanS+uksnIrGvE5NNT7Y1R/cTRS7aFfi1 wUXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si18728408pgb.43.2019.01.10.02.13.19; Thu, 10 Jan 2019 02:13:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726255AbfAJKIy (ORCPT + 99 others); Thu, 10 Jan 2019 05:08:54 -0500 Received: from mx2.suse.de ([195.135.220.15]:36270 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726925AbfAJKIx (ORCPT ); Thu, 10 Jan 2019 05:08:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 908DFACD1; Thu, 10 Jan 2019 10:08:52 +0000 (UTC) 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 To: Matthew Wilcox Cc: Andrew Morton , Michal Hocko , Andrey Ryabinin , Joe Perches , "Luis R. Rodriguez" , 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 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: X-Sender: rpenyaev@suse.de User-Agent: Roundcube Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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