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 B7B97C433F5 for ; Thu, 2 Dec 2021 03:27:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 10A7A6B0074; Wed, 1 Dec 2021 22:27:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0BB296B0075; Wed, 1 Dec 2021 22:27:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE99C6B007B; Wed, 1 Dec 2021 22:27:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0202.hostedemail.com [216.40.44.202]) by kanga.kvack.org (Postfix) with ESMTP id E353D6B0074 for ; Wed, 1 Dec 2021 22:27:01 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9E39F181D6CE1 for ; Thu, 2 Dec 2021 03:26:51 +0000 (UTC) X-FDA: 78871417422.02.F1C0B51 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id E7BF1F000090 for ; Thu, 2 Dec 2021 03:26:50 +0000 (UTC) Received: from mail.kernel.org (unknown [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 450B5CE219B; Thu, 2 Dec 2021 03:26:47 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 5850160720; Thu, 2 Dec 2021 03:26:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1638415605; bh=8KZOWZJGOgSkrHiFbAw6h6sRhqlpQcq8fbP2QGbC3sU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V0PEsvLyxDQveVxsOAFOx+yEnhZQP7AE6vQ3pZK/vweSyBODJkWYxuALmP73hgsz2 E6HrQb4OZPVtlmr4DhptKsfPs7G8cYfAk71rfg01usl2G/FucvS2QkFu0zGqSedcMH Oj3IYY1RLNIxNvM/eNXJCP6VCXEO0mUcOpoa1rFI= Date: Wed, 1 Dec 2021 19:26:43 -0800 From: Andrew Morton To: Bixuan Cui Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, leon@kernel.org, w@1wt.eu, keescook@chromium.org Subject: Re: [PATCH -next] mm: delete oversized WARN_ON() in kvmalloc() calls Message-Id: <20211201192643.ecb0586e0d53bf8454c93669@linux-foundation.org> In-Reply-To: <1638410784-48646-1-git-send-email-cuibixuan@linux.alibaba.com> References: <1638410784-48646-1-git-send-email-cuibixuan@linux.alibaba.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: E7BF1F000090 X-Stat-Signature: aksar7s4ns9pqesp8xonnq15f6fw8dds Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=V0PEsvLy; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1638415610-835541 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: On Thu, 2 Dec 2021 10:06:24 +0800 Bixuan Cui wrote: > Delete the WARN_ON() and return NULL directly for oversized parameter > in kvmalloc() calls. > Also add unlikely(). > > Fixes: 7661809d493b ("mm: don't allow oversized kvmalloc() calls") > Signed-off-by: Bixuan Cui > --- > There are a lot of oversize warnings and patches about kvmalloc() calls > recently. Maybe these warnings are not very necessary. Or maybe they are. Please let's take a look at these warnings, one at a time. If a large number of them are bogus then sure, let's disable the runtime test. But perhaps it's the case that calling code has genuine issues and should be repaired.