Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2055762lqb; Mon, 27 May 2024 06:36:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEzIrQIfgJ1O6/SWrM2ztuCL8xa7AxrHe7JruQzCxmdjZTahRL9QlG/r0FIBbeXf1K4X9nco9hjDl9G38LtDymRTyKwqcFoQ6hAAhmxQ== X-Google-Smtp-Source: AGHT+IFB8Y6GhnWCcinnoO3DBtdM0zSSBquzrYTJE2aTdNu0kgocFbMQw883XNzxmGcWRzAQEUYT X-Received: by 2002:a17:902:ec89:b0:1f4:993c:3629 with SMTP id d9443c01a7336-1f4993c377amr38570745ad.3.1716817005762; Mon, 27 May 2024 06:36:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716817005; cv=pass; d=google.com; s=arc-20160816; b=Zz1jeUXSrExxMmGfUNdSJDCwco2yxbSJ45jYrZFdMByr1k0dD3VOqIL02grVXYIx+s M6tiY61Cxkzo66dPN75qgM42DrVBLb+8p6TNrlH2UnwKo6/s9wiPEZ5BNOVy23lQySgx KLqt/Me9KZx+JEQsF4ZOHd3UzJPNbsQPIZJIi6eFEoX258cQwQj56LSXUbFfuRGJqrAl 3CnzgpsG+rw5B8Ygo70+wtMnk0U2+WCkWGSpv3gJeeV2ZCZpqYR9VECmQXmg3D90d3E6 KRUsG/A0W8BSMQlM+WaywzyixjB5dmuM6L4R+PH5uPByepZ6hkHOmjQlPSgid1PRfGh/ iBnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fAbpqHYArlgEA4jndUz59wBOUYS1i0aiS/4KxphB4UI=; fh=J5EX2kr2ZJPi0nWZFgB5sfsko1PPia5WIhHeT8ijmNk=; b=yqQDWszRBTz2KdbMxFFq6w8tAjxNN7XkLqCc5a/THFgJ4enRv2vt+faQwYVgIWKXTe nnsPJLZxL5UGyxy6kd3ZSqDoBEb8b+wKDhAQM/tKJA/UvLFWThp4xY+zve/Ls2TOw3sC HYsPJ1uD6gXIu4xh3kptV1T499K2Iyj0435Rbp+PIz6XRkCAsLtqVRUMnUsbPbRcc2QS 1kDciaAV9lv9baAy8lXTzKIKmpbB5N/6o78TYK5+3fOH9uhYZ6rlzcU7bchZdiuDGGmw GEmWeCqxacoXQi2IzRr57byOvGp9mz7qVuY5eiKhq+NrJYmX/Hsz4pdfiqS4/4uGnLnb 1YAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bg34lXVZ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-190660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190660-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c970cedsi63464565ad.231.2024.05.27.06.36.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 06:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bg34lXVZ; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-190660-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190660-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9B4E3B260A9 for ; Mon, 27 May 2024 13:15:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD57715E5D7; Mon, 27 May 2024 13:15:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bg34lXVZ" Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C31015DBC1 for ; Mon, 27 May 2024 13:15:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716815719; cv=none; b=E6hdvxRXOYCXUsYJeJQUy+QWobn/de5UMA7DuwAOgBof6r4JgqTQC6R8185x0gt1m9ABJV8vknlxfY8XuwK5fBko36+rOtf2iUFynbAk7fB9NPvlbBCuEtMyIW/Gw5gaQjV/W6MUywjqW+HZeW4bEyeqDCogWJ6BDytQupHOm2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716815719; c=relaxed/simple; bh=0Edaju5pGvykmoU4M2lpA68ncguVXLIcSKHtJCJSkOU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bZHHZmRAmjSJIyRFtapkAfcQu42DR68z1RJLGoeQWi7W8C+BPlo60Jf+HkOT8tItW5gVyhogiLJOq/X4uswkJo0GWM7+0apd4qplTYWOtjtTeeSXgaTsf7Tm95+1sShMTGdtswLdzbzcDKczjpwKeOQmI8KcSoT4f6c1eH+5vos= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=bg34lXVZ; arc=none smtp.client-ip=95.215.58.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: vbabka@suse.cz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716815714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fAbpqHYArlgEA4jndUz59wBOUYS1i0aiS/4KxphB4UI=; b=bg34lXVZhV597vXyWDG4RuvE8RbwP3Lwxz6YxhMDRmvdkRdQ9zgF/aLMSysVqr3vIk0XXR Gl7GlJa2JfxJLxT93Qf5EGxprVZuKjkPdnMvHnZdTW+x2+5yCkX/mTlIAoKjnOLWiYVP/N k1No0gau4uhxJvwiIcwpHCuAhrT+8SQ= X-Envelope-To: cl@linux.com X-Envelope-To: rientjes@google.com X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: 42.hyeyoo@gmail.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: surenb@google.com X-Envelope-To: keescook@chromium.org Date: Mon, 27 May 2024 09:15:10 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Vlastimil Babka Cc: Christoph Lameter , David Rientjes , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Kees Cook Subject: Re: [PATCH v2] mm, slab: don't wrap internal functions with alloc_hooks() Message-ID: References: <20240527090127.21979-2-vbabka@suse.cz> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527090127.21979-2-vbabka@suse.cz> X-Migadu-Flow: FLOW_OUT On Mon, May 27, 2024 at 11:01:28AM +0200, Vlastimil Babka wrote: > The functions __kmalloc_noprof(), kmalloc_large_noprof(), > kmalloc_trace_noprof() and their _node variants are all internal to the > implementations of kmalloc_noprof() and kmalloc_node_noprof() and are > only declared in the "public" slab.h and exported so that those > implementations can be static inline and distinguish the build-time > constant size variants. The only other users for some of the internal > functions are slub_kunit and fortify_kunit tests which make very > short-lived allocations. > > Therefore we can stop wrapping them with the alloc_hooks() macro. > Instead add a __ prefix to all of them and a comment documenting these > as internal. Also rename __kmalloc_trace() to __kmalloc_cache() which is > more descriptive - it is a variant of __kmalloc() where the exact > kmalloc cache has been already determined. > > The usage in fortify_kunit can be removed completely, as the internal > functions should be tested already through kmalloc() tests in the > test variant that passes non-constant allocation size. > > Reported-by: Kent Overstreet > Cc: Suren Baghdasaryan > Cc: Kees Cook > Signed-off-by: Vlastimil Babka Reviewed-by: Kent Overstreet