From patchwork Sat Oct 19 21:00:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kent Overstreet X-Patchwork-Id: 13842913 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 5E878D3C92C for ; Sat, 19 Oct 2024 21:01:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 676936B007B; Sat, 19 Oct 2024 17:01:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 627206B0083; Sat, 19 Oct 2024 17:01:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5157B6B0085; Sat, 19 Oct 2024 17:01:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 31BA46B007B for ; Sat, 19 Oct 2024 17:01:24 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6344D120DB9 for ; Sat, 19 Oct 2024 21:01:11 +0000 (UTC) X-FDA: 82691572026.26.5CF1295 Received: from out-181.mta0.migadu.com (out-181.mta0.migadu.com [91.218.175.181]) by imf03.hostedemail.com (Postfix) with ESMTP id 4925920009 for ; Sat, 19 Oct 2024 21:01:14 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vRv+si35; spf=pass (imf03.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.181 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729371607; 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=pEIDIRoh6F6ashFanYNpQIOpsglJrEZdQ2icFJowamQ=; b=b3tg/3U6rLLjliXf7cg8lqTdmKv0m1SYBNJF2QL5Kc8JY4uFm/XWWHqz1nFFys7lrSeA7z XsgqPzOSuqrvYRCCRAaat+yxvo/SlJgl/RwbGr38KcZZOBnund49dHeOTrA4WIfny2Baym ZJhg/jNU05IZ2UrY1HldJUe9Fvmr14E= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vRv+si35; spf=pass (imf03.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.218.175.181 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729371607; a=rsa-sha256; cv=none; b=NMlrYBSak6ZM4HFBX3U6tJVU4QDIGBaNA8g3ZTfX3NpNngi7azxemGIFB318a476QlNqGd t72mTZBm0FFcw+IqzEfjlEUMVmM5bqAVlCcBSjOtyP3xB8xXVrziF9a6eWOl1Rp7hgCuRX LJiSaTBNTY33vsIsX8A5V2RmQg/MByo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1729371671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pEIDIRoh6F6ashFanYNpQIOpsglJrEZdQ2icFJowamQ=; b=vRv+si35LfF2ciGUvniLf6L1wb5tTA/9aE/9fhCV2jSH7yznXkdec70BqdmI6V5igvKffM E4tS9jlCIt+/HbZLxXmRI8QmzR0rhHKeJSpKGVRpJqL3HB7sgnMHf1wxzNdPHKH8c6ZWi7 biI3uzfi8Xuu0un2GZV0M9XUybJqbYM= From: Kent Overstreet To: linux-bcachefs@vger.kernel.org, linux-mm@kvack.org Cc: Kent Overstreet , Vlastimil Babka , Andrew Morton Subject: [PATCH] mm: Drop INT_MAX limit from kvmalloc() Date: Sat, 19 Oct 2024 17:00:37 -0400 Message-ID: <20241019210037.146825-1-kent.overstreet@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 4925920009 X-Stat-Signature: riq1de5u4qgeib764m1s8cucaw1s4yic X-HE-Tag: 1729371674-994558 X-HE-Meta: U2FsdGVkX1/7hcZRI1dqsiMSDkSKxwK5usO1OdyEuxMyogCHJRy1SzZIOuHjMnH4HOeA//WA20Obu4sDe/+ulitvv44+bOWfZ0Dkb7lmZRm5VbqHfyKGNAzf75NwbdzP9lo2z4MRdFzWRXmoKKVsAvxori2qQhcjxu6e3paR8u79KliiKAQIDJgNHXvmzR9GT/eV9Q735BxYmr+JAraml443xhWuzkFpS2PJZHBrMJ7eW7yXv5p4/rnv5E7JY45EOy8Vr972ic/rTezfeAR40y8p1Y5JBrnHvQVi6udCACIhaX3lUykuG90rTWk7MExYKZwSnvsn3jP9ZFepHLJ1b7Vp1RK1iFS48KHWe/DSKTFFLO0Z6xBOICwJJMe3NuhZdCe09vJh3b6td9ZsSxzhfwPuadkaxvQz9cOB45ZS8MEtFC+tlxE51mVdGF3sR6cIPq6cHu7GsYqme1e69//P3qljDWi3wiFmatcFLxC46s6VQnbMo/ZCWEYLgtY3D3ia8JENKA8BCZnYwADvo1XdAbC3777LBZvyYxgdBdegJEthew92ZueHkXPpYSRT7YbNJbLJM5GB3AonMvPcLW6KxAJwJ3d1zWFavfnAeWG3H4GM/F/0JWihnDqXRdTzlSYBY7oLMwEXt0zgDZAYkuhdQpTV5H4oVg6EuyNzOmWQZTVgi6ky74shi1m1XJKdjijHhi5VHwC8e+q41yKdAPjdMiu9v2v+XaPeSEG8F/LVVT1hDtLw4b86nqXWMoh2fse29HVJO6ADbnwxcMPf7YrdI7hNm3lS5ry27JHRrx4sQe2r/TM9wyu4qN6hcyxcsdceFkwMsiuhYWjCh2XeAtkc3kLPlKJTV544p+cA51t7yYofvnEz86SQrUFpb3zNPgm6si5ojONqPP3ZRt0Z6e0ZM8pBC413hnjeQJ4E3ZdvwYndv+tiYXVY/QvSiq8rkfUVM6I9MdjBI7TXUbQAQj8 iI7E9OJY IHYFmwheDegFDpDSlkgaPTn0r2CsGJ8wy22y/h6w5Z5zIJoGKD5VgQwqFyfXELeLLPKy7x0ZK6MoJLK4ltkU+LNUoLjUXbQR9VvNd9oQjpDjxaqc6kASzGq5A2pKvTD6MQjC4W9r/ZVdT8NQfW2FHmHgrUbQ+YX89g6KPJCXtBU6q9J79uGBAmzGC7f2JNEH0raCweg10raE0lv8LZbykjOBU3ltETj/zbxlJsDobIWWEJqjBi1itqKyw6khmk7klin/j58L1II2lyV0= 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: A user with a 75 TB filesystem reported the following journal replay error: https://github.com/koverstreet/bcachefs/issues/769 In journal replay we have to sort and dedup all the keys from the journal, which means we need a large contiguous allocation. Given that the user has 128GB of ram, the 2GB limit on allocation size has become far too small. Cc: Vlastimil Babka Cc: Andrew Morton Signed-off-by: Kent Overstreet --- mm/util.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mm/util.c b/mm/util.c index 4f1275023eb7..c60df7723096 100644 --- a/mm/util.c +++ b/mm/util.c @@ -665,12 +665,6 @@ void *__kvmalloc_node_noprof(DECL_BUCKET_PARAMS(size, b), gfp_t flags, int node) if (!gfpflags_allow_blocking(flags)) return NULL; - /* Don't even allow crazy sizes */ - if (unlikely(size > INT_MAX)) { - WARN_ON_ONCE(!(flags & __GFP_NOWARN)); - return NULL; - } - /* * kvmalloc() can always use VM_ALLOW_HUGE_VMAP, * since the callers already cannot assume anything