Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp871887rdb; Thu, 15 Feb 2024 19:55:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZK/GlgbocLV2W9E3TSiSmnpSZYgYd53HYOytWMd+L4WkIEKat+hFnVjEBe9Tf6t3leMawHXKm0Zhufcqq6dq1HUG8RyDcQlEOAlS9AA== X-Google-Smtp-Source: AGHT+IE4xOIb4SzORkHYQ91C7h47Iecnl/l+wCyl6HV1VUOs3I5rpHkdX77fv/+S7zrnRm6cledQ X-Received: by 2002:a17:906:3e50:b0:a3d:20c9:6ba1 with SMTP id t16-20020a1709063e5000b00a3d20c96ba1mr2516950eji.39.1708055710486; Thu, 15 Feb 2024 19:55:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708055710; cv=pass; d=google.com; s=arc-20160816; b=HgMuM+erpDy0wrvMX/oPYg4Zn/TNImM1dCeiWjNDFoW8hUOdEeg5rTeZlIHOypSI0r FJfDYaZpWY2PM+6h0VhapE8HfUWoMshjQwLerrPIEn1Om1r0izvuWP0n9wfCjAQTMTQi 2Z7tqPS2rSqzXArpqjvSnJehKFc/TGArGvD+7qeFRklviaqsIYJ4Flh83wWLBanZBvsQ +xcNb1Srwvquq6hOIqMEoejjl8MBnsWARvw9YEZD4ksQO5HOumzwp+B0GvbqgV3j6qzG EKJh/Kdo9kVea9zE3MTQyhE+OYpzDLpaPu9i60EeFFsJiD2oqU9iSBXGq3R1iZ9aY7Wc lS+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=6zHtN1FZm2hb7D8NWh4qPbFReA57r/z6mK9bZdqJdFk=; fh=x4jHTxhCUxhgUYudD9AcB54IFffOv8cRjua59MPq7j4=; b=RVmuKh98lkIOAMP0jznRTCCq1UkoVCq2rdoaUX1b02WB9m12LgJoHHYObRglaZJxZV mA05+rj5IXzL1ZxRc4a6Ua+C3If97KAZH1G2vsHxhhGE7QKWEKS+BMb0FLKvY63EhF2c tg5AjiS41mAZqpdeTHH5sV/PQ7R1/YfDX015ZY+KPhNhfcEjgga8sVZonHN1wRC1A9id /troj37VYS2/Li6UbdJHT8ZkpaJiZDXpuDw6BEPxMIQGL3g67xtIR7TAypyp9OskiHGF /84AKW7DLUpFrBk1vFQe8TJYI8pu6L/SRuUhUmZHYvuNuJONs7ezBx7kwSPQ4e+NWFNd XUkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=C5kAc6RZ; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-kernel+bounces-67991-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s25-20020a1709066c9900b00a3d68ba92a3si1273548ejr.260.2024.02.15.19.55.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 19:55:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67991-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=C5kAc6RZ; arc=pass (i=1 spf=pass spfdomain=paul-moore.com dkim=pass dkdomain=paul-moore.com dmarc=pass fromdomain=paul-moore.com); spf=pass (google.com: domain of linux-kernel+bounces-67991-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67991-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 374CF1F239D4 for ; Fri, 16 Feb 2024 03:55:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 614DBFC0C; Fri, 16 Feb 2024 03:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b="C5kAc6RZ" Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BD78F4E2 for ; Fri, 16 Feb 2024 03:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708055703; cv=none; b=W/ipWZJduIYiAyo/jsWifPXUkyDgxaTxoXGScS4NfeJJOb/GJz/wjjaNAQhN1zis4ZKIzZ5vR2hsV4CnpbB+8Ow5Dp6twguz21+O7HfvYeZpdJk9nYPBo3ByRn6Es7PmOYuzPOZArwA45NLeNF+auhSMutvkpx2i2+gtlFcQF+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708055703; c=relaxed/simple; bh=V0jgQ2Lgx742mFZq4Y6LE1tkLcmU8d6P9Zpj7Y5krYU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SPZ1i6xL0NIJ/zwzZskTCue7KfwCPb5SIGLLavqN7sC77Aw2qZkE0iutEsHvy7bcZdjgVLecuYGWYVMgKCB7kC4F8pId+vZZ7r+ZQ7/tKOel82fkBChZAM36j9TnaQt8n6S0cwfeDIleR1KQ/g0qFQwORaMJk0OaU1TqjiIZfpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com; spf=pass smtp.mailfrom=paul-moore.com; dkim=pass (2048-bit key) header.d=paul-moore.com header.i=@paul-moore.com header.b=C5kAc6RZ; arc=none smtp.client-ip=209.85.219.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=paul-moore.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paul-moore.com Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-dcc73148611so1786600276.3 for ; Thu, 15 Feb 2024 19:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1708055700; x=1708660500; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6zHtN1FZm2hb7D8NWh4qPbFReA57r/z6mK9bZdqJdFk=; b=C5kAc6RZ0B8oR1HimzlM3+1eI7ccKE3zzSL81H2DPkUHA5lExAXg9sj8gNx0ubNhR/ u+KFF1X5g5DinHpM+CimjMFLJ8z4Mvmgvw3vMw7U4O1VAeWQ2BOKeRyLPjN550ue9cRu Oxt2nsO2x5qG5QORSPdmFxuHZcJ8cN8mpGIBUWxKTbuf3YkcmlrfVcb49++rl7w5bjj8 M4Xu/d/ACDjOrNW/QJlmyabiFpl6efb+kZ0mfnr9CVUBt4ZVa+ikrHAEx4YSb2j1gZi4 OkMLe/lfh17JeC2pXg2pF5dNkJqmNqp3uv0JcBu5P9irnsGotANUag+V5SoqyrrfBIjs VoAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708055700; x=1708660500; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6zHtN1FZm2hb7D8NWh4qPbFReA57r/z6mK9bZdqJdFk=; b=gs8NQZUA0GZxycTiQaL7HhI+8OGjPNmlofREN4atGrTsI0+f0ZYg/FWcZDE0IIuJ+J +6CgGQHePGuSYyF1ICphxcZLR9aQxHrB4lWbyV9fhDFlPKuzezT47ebkYXLvq1UmAfeg asVvtXVw/Lia1FdFMEoLAgE9WIbrIv+ZYLih7Aq9ZjfF0N1NE+9yuUe7HRUL5lCxWjyH OsCJnajxsZ9GFYF406eUD/ECfbOP7fYI1koh5KJd/UdjhAzT9xscugLw46YhcDsxoHZD 570Ra/Ela4wSZzNeMKPZcYypzbaMGJt9vETidIXC7+PaZkgUnQzIcH1dJyBAtOhqxtf+ DKkw== X-Forwarded-Encrypted: i=1; AJvYcCUEa58Tu0+RBG8u6rmQw1VCoSzA0DbJK3JBs5LcnFDPRmXvt+MiBZjTF5O0fGDX4zLzXYvuBk3ke8q7gj/GudkagdMJr14ZEQvERk/u X-Gm-Message-State: AOJu0YxWkxLphc6rFVMvDdC9QaPH5oBwIsTH+hxxEAnfXfHzynBIM84G f3HE/Klt4E4dnLIxC9VsxbokpIPpwBB2okjh9NcOGR4bTZLefBJrR3NXfR46exrT5y4SIKjyafN BVgL8L2By6Am3YgQpyg7A2Xdl7qClBUIDsMVsbF8IK7j4oYo= X-Received: by 2002:a25:820f:0:b0:dcc:dbb8:ba73 with SMTP id q15-20020a25820f000000b00dccdbb8ba73mr3698256ybk.9.1708055700055; Thu, 15 Feb 2024 19:55:00 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130094037.76895-1-chentao@kylinos.cn> In-Reply-To: <20240130094037.76895-1-chentao@kylinos.cn> From: Paul Moore Date: Thu, 15 Feb 2024 22:54:49 -0500 Message-ID: Subject: Re: [PATCH] cred: Use KMEM_CACHE instead of kmem_cache_create To: Kunwu Chan Cc: axboe@kernel.dk, elena.reshetova@intel.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 30, 2024 at 4:40=E2=80=AFAM Kunwu Chan wro= te: > > commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation") > introduces a new macro. > Use the new KMEM_CACHE() macro instead of direct kmem_cache_create > to simplify the creation of SLAB caches. > > Signed-off-by: Kunwu Chan > --- > kernel/cred.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) This seems reasonable to me, unless I see any objections I can pull this via the LSM tree next week. > diff --git a/kernel/cred.c b/kernel/cred.c > index c033a201c808..02a96e9d9cfd 100644 > --- a/kernel/cred.c > +++ b/kernel/cred.c > @@ -606,8 +606,8 @@ int set_cred_ucounts(struct cred *new) > void __init cred_init(void) > { > /* allocate a slab in which we can store credentials */ > - cred_jar =3D kmem_cache_create("cred_jar", sizeof(struct cred), 0= , > - SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL)= ; > + cred_jar =3D KMEM_CACHE(cred, > + SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_AC= COUNT); > } > > /** > -- > 2.39.2 --=20 paul-moore.com