From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF8CC27C44 for ; Thu, 30 May 2024 16:13:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C0AC6B0098; Thu, 30 May 2024 12:13:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34A636B009B; Thu, 30 May 2024 12:13:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19CC86B009C; Thu, 30 May 2024 12:13:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EA9376B0098 for ; Thu, 30 May 2024 12:13:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 947A9A17F1 for ; Thu, 30 May 2024 16:13:49 +0000 (UTC) X-FDA: 82175558178.04.39118D9 Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158]) by imf03.hostedemail.com (Postfix) with ESMTP id 7968D2001B for ; Thu, 30 May 2024 16:13:47 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm1 header.b=2Z+pEZqk; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="Y ydCgRD"; spf=pass (imf03.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.158 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm; dmarc=pass (policy=none) header.from=fastmail.fm ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717085627; a=rsa-sha256; cv=none; b=VcdLZLOZLj5SELb4fPvOU1bVjiRCTNuL+yLmlnBMrPg5CbDqcD7iQSJ8uY804bq/V5MaiV su5V1CDa+m+nxpzWg/diHGAJ1xgmHCrjvwjFG89zIEWWVhewub9MUkueDj+EZDzz19ObVC g/b57twqMxWoTAVHENQshlfnZFWseWI= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=fastmail.fm header.s=fm1 header.b=2Z+pEZqk; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="Y ydCgRD"; spf=pass (imf03.hostedemail.com: domain of bernd.schubert@fastmail.fm designates 103.168.172.158 as permitted sender) smtp.mailfrom=bernd.schubert@fastmail.fm; dmarc=pass (policy=none) header.from=fastmail.fm ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717085627; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nK3Lj4ZuV/ERTvvAkah+/X2JPuxGOZYdbmNhhRX1/zQ=; b=3Chvn2wUKx1ZP+clcsW4qROwQnTR/FNtNdvtRFXmpN51sAC3s01bPxdOSJ4HC/q9MdVlGa 3Mg4nh+qv/9PemSMfwd0yDOHe16R60NsC3gwqG8C7M8Ifpuh6gJ8CDP4pXg4A+9P0ibh52 YbhxAt2c7r2Cw6IHbdDLnxhSZReigaM= Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id C4F39114014B; Thu, 30 May 2024 12:13:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 30 May 2024 12:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1717085626; x=1717172026; bh=nK3Lj4ZuV/ERTvvAkah+/X2JPuxGOZYdbmNhhRX1/zQ=; b= 2Z+pEZqkjjhd5Er8u1w1Wp6Q48mngOphXnsFq6de/dJQ1eEylhJLw0i4gt4vtOBi geHvZJc8XTt+HCOh5vMwTBlwc6mm9rGzHngmWxEcfurtgs+g448yj9xTUpdZWv7j smroxK/GooV8wL7pLFj2UqOaNHYdkWQEgkzPQLWLTrhqE/79Ec5M+EFDDOQUKbaT F/QnmdE7ltSd9Z2cLgIAKkjaeG/3Q2kqlgHXDwEqCMlICejxdDSSDDUVjuRXVi3F zRC3yDckFj2yj6TuR0+qobAHCoxG2apbIfLkwhmrsgjRU4urEHdtFcIBPnY4tdox Yr0SiwDOcf+sool4hbVROg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717085626; x= 1717172026; bh=nK3Lj4ZuV/ERTvvAkah+/X2JPuxGOZYdbmNhhRX1/zQ=; b=Y ydCgRD4i7KGwqXyciUrtd/MmnvTuYvJKAFqvRuLfz3ly8TGo3/oF13LTGWQ0U9xV iv7xj69ZNyZJSg+aeA6mTdwUrgBF5wSljx7SlezA1rpzvv/6D455239jpP/B5URy M6QyB6/Av3+BxUbx1EggWSZpVmokz4RWuPCheCNn3ApR1o8bWUBqsOJhL4+G3r1U mVD9uglfMP3TA21oelogadQaA6uiGRgYeN3eEb3V/kT8rQ65S5M+0hE4QcFIOtRR Cuj243kJMuEssHiJce2H+e+aL3ZiZJ5JOVkZhuN/Q9myl01tJIEiYGlh+1VsHeh2 L29F0rpwzvRWqd7G2BXDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdekgedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeeuvghr nhguucfutghhuhgsvghrthcuoegsvghrnhgurdhstghhuhgsvghrthesfhgrshhtmhgrih hlrdhfmheqnecuggftrfgrthhtvghrnhepvefhgfdvledtudfgtdfggeelfedvheefieev jeeifeevieetgefggffgueelgfejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsggvrhhnugdrshgthhhusggvrhhtsehfrghsthhmrghilhdr fhhm X-ME-Proxy: Feedback-ID: id8a24192:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 May 2024 12:13:45 -0400 (EDT) Message-ID: <61ea7870-c375-48c9-88e2-6f17fe4ab864@fastmail.fm> Date: Thu, 30 May 2024 18:13:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v2 06/19] Add a vmalloc_node_user function To: Josef Bacik , Bernd Schubert Cc: Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org References: <20240529-fuse-uring-for-6-9-rfc2-out-v1-0-d149476b1d65@ddn.com> <20240529-fuse-uring-for-6-9-rfc2-out-v1-6-d149476b1d65@ddn.com> <20240530151001.GC2205585@perftesting> From: Bernd Schubert Content-Language: en-US, de-DE, fr In-Reply-To: <20240530151001.GC2205585@perftesting> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 7968D2001B X-Stat-Signature: dsrdns7nj5srb3ubiyyzpfp1xcssfung X-HE-Tag: 1717085627-371030 X-HE-Meta: U2FsdGVkX18Vly0ZwSRpfHf8yDaRToBUct0W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iil6nFhd6QC+XfwKvDfx5B3YdMOQL+/bMxCY171NW+yKmR09E9/Oc3K+g9LkGq34tiWo383MnUrxKwXl+eu6Bv1k2vXVRrm9pBJF493YHoPPNZra9NGpg4AtnTcV+VKm6xU8q8dYmnXIyiC26MgIw/RxZNR696l55GDGGJwbuwFrNLcoKvxzGpQgpGIzHKnx+IZHiM2YECu4LjPltp4oNXO9R0KPsJOh+8nBP8nPq0XqjY5J3u3xetg9gQUTbbiVmPTIr2btyeTy8I6N9EpKVCcdxwr89o8ggcTM5nGNTgu60GV0c8j5aE95fcCXP3nPbiUiyOaaAijsMnVnuuxmMX1XHYqB8jNtR0dfCCe3N3uLWCPJKwHJlOjyNkTu+HWJ6V0Ef1dup5tGBNq+Yk7NPODBf4g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 5/30/24 17:10, Josef Bacik wrote: > On Wed, May 29, 2024 at 08:00:41PM +0200, Bernd Schubert wrote: >> This is to have a numa aware vmalloc function for memory exposed to >> userspace. Fuse uring will allocate queue memory using this >> new function. >> >> Signed-off-by: Bernd Schubert >> cc: Andrew Morton >> cc: linux-mm@kvack.org >> Acked-by: Andrew Morton >> --- >> include/linux/vmalloc.h | 1 + >> mm/nommu.c | 6 ++++++ >> mm/vmalloc.c | 41 +++++++++++++++++++++++++++++++++++++---- >> 3 files changed, 44 insertions(+), 4 deletions(-) >> >> diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h >> index 98ea90e90439..e7645702074e 100644 >> --- a/include/linux/vmalloc.h >> +++ b/include/linux/vmalloc.h >> @@ -141,6 +141,7 @@ static inline unsigned long vmalloc_nr_pages(void) { return 0; } >> extern void *vmalloc(unsigned long size) __alloc_size(1); >> extern void *vzalloc(unsigned long size) __alloc_size(1); >> extern void *vmalloc_user(unsigned long size) __alloc_size(1); >> +extern void *vmalloc_node_user(unsigned long size, int node) __alloc_size(1); >> extern void *vmalloc_node(unsigned long size, int node) __alloc_size(1); >> extern void *vzalloc_node(unsigned long size, int node) __alloc_size(1); >> extern void *vmalloc_32(unsigned long size) __alloc_size(1); >> diff --git a/mm/nommu.c b/mm/nommu.c >> index 5ec8f44e7ce9..207ddf639aa9 100644 >> --- a/mm/nommu.c >> +++ b/mm/nommu.c >> @@ -185,6 +185,12 @@ void *vmalloc_user(unsigned long size) >> } >> EXPORT_SYMBOL(vmalloc_user); >> >> +void *vmalloc_node_user(unsigned long size, int node) >> +{ >> + return __vmalloc_user_flags(size, GFP_KERNEL | __GFP_ZERO); >> +} >> +EXPORT_SYMBOL(vmalloc_node_user); >> + >> struct page *vmalloc_to_page(const void *addr) >> { >> return virt_to_page(addr); >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> index 68fa001648cc..0ac2f44b2b1f 100644 >> --- a/mm/vmalloc.c >> +++ b/mm/vmalloc.c >> @@ -3958,6 +3958,25 @@ void *vzalloc(unsigned long size) >> } >> EXPORT_SYMBOL(vzalloc); >> >> +/** >> + * _vmalloc_node_user - allocate zeroed virtually contiguous memory for userspace >> + * on the given numa node >> + * @size: allocation size >> + * @node: numa node >> + * >> + * The resulting memory area is zeroed so it can be mapped to userspace >> + * without leaking data. >> + * >> + * Return: pointer to the allocated memory or %NULL on error >> + */ >> +static void *_vmalloc_node_user(unsigned long size, int node) >> +{ >> + return __vmalloc_node_range(size, SHMLBA, VMALLOC_START, VMALLOC_END, >> + GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL, >> + VM_USERMAP, node, >> + __builtin_return_address(0)); >> +} >> + > > Looking at the rest of vmalloc it seems like adding an extra variant to do the > special thing is overkill, I think it would be fine to just have > > void *vmalloc_nod_user(unsigned long size, int node) > { > return __vmalloc_node_range(size, SHMLBA, VMALLOC_START, VMALLOC_END, > GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL, > VM_USERMAP, node, > __builtin_return_address(0)); > } > > instead of creating a _vmalloc_node_user(). No issue with me either. I had done it like this as there are basically two caller wit the same flags - vmalloc_user(size, NUMA_NO_NODE) and the new vmalloc_node_user(size, node). > > Also as an aside, this is definitely being used by this series, but I think it > would be good to go ahead and send this by itself with just the explanation that > it's going to be used by the fuse iouring stuff later, that way you can get this > merged and continue working on the iouring part. Thanks for your advise, will submit it separately. If the for now used export is acceptable it would also help me, as we have back ports of these patches. > > This also goes for the other prep patches earlier this this series, but since > those are fuse related it's probably fine to just keep shipping them with this > series. Thanks, Thanks again for your help and reviews! Bernd