From patchwork Thu Jul 25 14:11:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danilo Krummrich X-Patchwork-Id: 13742008 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 A027BC3DA5D for ; Thu, 25 Jul 2024 14:12:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0D77B6B0089; Thu, 25 Jul 2024 10:12:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 087616B0093; Thu, 25 Jul 2024 10:12:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E906F6B0092; Thu, 25 Jul 2024 10:12:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CAD6A6B0082 for ; Thu, 25 Jul 2024 10:12:38 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 686E91410F5 for ; Thu, 25 Jul 2024 14:12:38 +0000 (UTC) X-FDA: 82378465596.15.FB7D1E3 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id BD4E840036 for ; Thu, 25 Jul 2024 14:12:36 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hmkjug9L; spf=pass (imf11.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721916755; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=fvD3uoYMX7PQaX9IHgHYfxU7XW7dI5+Wsoa5WnknSZc=; b=J97SdLnMNU9ee2kM904DDF40d6Px3w+AggksI0Tjjc/lkcBMHfc9Csbz8t5nP8J99eFqh8 3dLX/3N/IWnh+FnP+8OymqU73sROw+/hHtcJKfPpjWDKg/0ITc7ytdoVZIV9cvwTf1rjDL EWihNZnYzll5pxRqld1SnHzTsQfBCk4= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hmkjug9L; spf=pass (imf11.hostedemail.com: domain of dakr@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721916755; a=rsa-sha256; cv=none; b=UneIKb8h2iN3BXxjeD8kL86WhNP2dfvj9hvrU5+aZdnaAbrko/4oZl+7epIqvBBzF6xSYg qFc65WGXoq9eDrnaodnVILXHPgfG2d4oYInpGg32ImaA4utuTDaw7k06F4PeyEUduhZKGp vPpnqhRqB9XWdva2b9O7iG16B1D9S58= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B8F2461242; Thu, 25 Jul 2024 14:12:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8B63C32782; Thu, 25 Jul 2024 14:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721916755; bh=YpwqHwqCxbfGR5XXSyE8NyczHvTRd1aASBcmjNjGQQE=; h=From:To:Cc:Subject:Date:From; b=hmkjug9L8/38AbPc3btxpTvCLxDuEkibXU4G0LhcmOsaWvhd4hV7YNYU5ko1nkEXe Ti3FNCOBa7gF+MbPAYIFgSYqfgFvPEJlQp/R486ap/LGJzb3vO3NT22G41443SK5MG b/Z9XHA5eyEefs9yCB6/ZNfKeozgv+s8OizIAovj+tiwwGi2YbwAZNQHUmBVsn3Fb7 zVI52lzbHrpKUkmFHCoEbKKPeqwJpDUMk68R0DMjHVSeXPF66TZ7KnJ9+cgdFCa8kf RKdLnG19G9CYP2gnw2glgTEQC1HCwLRbLFaGXy9MfAhexdosXm/l86GFXRc6AX4zys olbjmKMGHAWhw== From: Danilo Krummrich To: akpm@linux-foundation.org, urezki@gmail.com, hch@infradead.org Cc: mhocko@suse.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Danilo Krummrich Subject: [PATCH] mm: vrealloc: fix missing nommu implementation Date: Thu, 25 Jul 2024 16:11:59 +0200 Message-ID: <20240725141227.13954-1-dakr@kernel.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 54mw6k9i96h6kcjzi1517ne14g63h3rz X-Rspamd-Queue-Id: BD4E840036 X-Rspamd-Server: rspam11 X-HE-Tag: 1721916756-413 X-HE-Meta: U2FsdGVkX1/C2fJ3Rq54yeum2ogE+engr2jfiaLTlQEgkf2hZly1WH347Rfx5T4Cxl0YBWW2w56TqV4khY2kMl2Qg6Kczle34BQ2b35pL5VkdvPzk5gd5EXnXatfXS6VCUYdc4ilhBrZW9reZeAsJlfbj0TF1VJM86ZO7kbBaaTdNSnsKKblbgYPAoeXz/DJtCfzVcmD+iUsPsk2hkE5Jk6cNCMNVOrRyFkZysMpBFEk8skAuEz+iE0DEKBb/+SaZEmZBSXDxMCW2K8aK6P0zzSrPJ9XvlL/R1HJKBDVhMArVqRf3oiZCaJFWPRukK3rPVUQhI/68ig5onpQBj1GIOnE6MjxM5usi67eqroepXm225et965d7ctJdDsvIEiBPkcKiX7dhCQWWUaS2NVIzoxdv6wfUIduWnC4RzjSm26cZOVNsZAHugEeuuNuYZ8RiarfVcPJni+kFbhF8/0FhTMdr9H9dEnBVPuSwgoqgOmVxVKAPurR9I74eVZstAxy5UTuqCrTVNMvXFHVUu6SoF1qmWiq7326PNLEhihuezuA9iglsoyOgDzreoB7aOQomx1zm3uKgBQeWWmrkiSTXvBGqQzKKm2GAH1IKSX0ihALt3TFd1iO7PoMffvR4l2qjE20KoanOfGaAm9uJnkKa0Kx36FzM4HRl9rzELKfQTj9gRO1QZqy6xb0N862WacQG7q8dai9NTivTiSvbX85lsegLCutPK23XomRWsnroS4HauAhscWzztYSwmBg24HC7EJLz/9KSVdNvC/tbkF0dTVRRHuwD9M+yTa8DNgEbazfTWUYSNkAiXjX+1zn/7KxmCpQSisVIso/cYG3yIjTYUxc5So0BV5M3lnv9Oghr5uMwfu7P89m86Ok9NwGMKaqSbGNY4O2KuqYUWEFT/6n6IVW91djUCwXVgbAZdamaslyyaMNI9hmldxt+rWJC99n7njJOHlgRqd+g6/nCAG h5d0aI2p zo0AQy0SdHug4qW09Al2ijV/FAtrRKbEjcN4dSc1OVjnQF/JYzTie1pvewWhfjaglEpEqhBOwYGrWCE+ux8+oAzr8KuKQ+WtefdTtUZaHFiXwvIjRNYTg7RVU5/VMXJlXFn5/4ZJN0tzF0uq7/fE6kToX50NmvdcH5fVUoWhkW0EulGQEJ/AVhj/XBQHy2K0TSn8tv41Q5349vgwAjAkRxHTO689LyJ8mSpLsO3Bt3cDW61s= 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: Commit 5ec6d992f460 ("mm: vmalloc: implement vrealloc()") introduces vrealloc(), but lacks the implementation of the nommu version of this function. Note that currently nommu isn't actually broken without this. The only user, kvrealloc(), never actually calls into vrealloc() with nommu, since it's guarded by is_vmalloc_addr(), which for nommu always returns false. However, since this becomes a real issue once vrealloc() is used by other code, fix this. Fixes: 5ec6d992f460 ("mm: vmalloc: implement vrealloc()") Signed-off-by: Danilo Krummrich --- @Andrew: I picked up the commit id from mm/mm-unstable, which probably isn't correct / will change. Please let me know if you'll take care or if you want me to just send a v3 of the original series. --- mm/nommu.c | 5 +++++ 1 file changed, 5 insertions(+) base-commit: d270beaca6818349b2aed7e6034b800a777087cc diff --git a/mm/nommu.c b/mm/nommu.c index 7296e775e04e..40cac1348b40 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -126,6 +126,11 @@ void *__vmalloc_noprof(unsigned long size, gfp_t gfp_mask) } EXPORT_SYMBOL(__vmalloc_noprof); +void *vrealloc_noprof(const void *p, size_t size, gfp_t flags) +{ + return krealloc_noprof(p, size, (flags | __GFP_COMP) & ~__GFP_HIGHMEM); +} + void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align, unsigned long start, unsigned long end, gfp_t gfp_mask, pgprot_t prot, unsigned long vm_flags, int node,