Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1346026rdb; Wed, 6 Dec 2023 16:37:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWyLK3X/zEVFr/L0piYhiYmKL9qADC4qAQwi6mozZjcdJpOYZlmC0UDEzaSKvuH05tqUHl X-Received: by 2002:a05:6a20:4b82:b0:18f:97c:8a49 with SMTP id fu2-20020a056a204b8200b0018f097c8a49mr1660138pzb.116.1701909444975; Wed, 06 Dec 2023 16:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701909444; cv=none; d=google.com; s=arc-20160816; b=VPIRp8Azx3THTzIEzYzzYEKI6XrwPPRTYd2cRby+DE6vTAipNB7BkcphU/BR38ICna VjG8TFq4CcZZwajPEPzA3qMUeWT103aDBoabgXdRHcS6Y4mInN73nNU+zmejddXbu42l KQltbs2drN+HbBR3TppCpChlIG2OCIB1Ozp7+Oo+byc0+FIptY5Ml4IkuYf1W2TP+908 +NYExT3oYwF2HCywXDf8/0x7dRGUNj/fYeBzLN+O1cfvAxPFEACHJG1AYro/7IOYxsfd xojw+gXwqwr5ohEGVuQE0TEAQxA3PWjaPkFf6YJ+fubeGnK+JS6hqIoBOnQ0GO454ykV ying== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ku2sfUBBqRmjOusEjPPKSg3scPnZYVUEi+HsErMF7+A=; fh=OvCUO7VSi2qhFSf1pAk0DSxAfqIFciTB3JbkL+4/94M=; b=j8eEGo8HIN5OvB7w11YBp7BQA2RiWzKyZURopIE9ZlPuwfXXQcpZWGpUP2vweJ5U/s 23JwG5tQAtls9XxkrKRNvwMkzFbP8k5TYI5i8XqpY4UMHu69tAazJmRLCHUDwVWLIlCE sCaNmvGfiL+m9vp9WRZNDXXOzGMg0VBiCJvmrCznEGilbvoifufWLBuX5K7YCB67Gn1O QQNF7c98twYxqLlh+Qq8WZ5WHC8P9T+K3v/5kzAV+uaK3rHSkMDknyLM3XARVBiw9jAX RPWYpCLuIQT7CSMdq4YA+0WFRktqjsUxnnsUln2lqLgXqvE0d1n8Zx80WBNA6IaV7yJi 4JmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=SPwGi2pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id a190-20020a6390c7000000b005b928c7b284si147930pge.587.2023.12.06.16.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 16:37:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=SPwGi2pt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 6FA4E82F9173; Wed, 6 Dec 2023 16:37:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231205AbjLGAg7 (ORCPT + 99 others); Wed, 6 Dec 2023 19:36:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbjLGAg6 (ORCPT ); Wed, 6 Dec 2023 19:36:58 -0500 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BF26D4B for ; Wed, 6 Dec 2023 16:37:04 -0800 (PST) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dafe04717baso444565276.1 for ; Wed, 06 Dec 2023 16:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1701909423; x=1702514223; 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=ku2sfUBBqRmjOusEjPPKSg3scPnZYVUEi+HsErMF7+A=; b=SPwGi2ptt35RjW8bl6Bv3xg1CBoMWvUAhzx1qCZRYVa7VZCKadoKF/GnxnJRqH2j4s wfQy9jtUvON7V9UMtzbf2vCyDrKW8xbfDFzbHr4DS+Cdw5g8VaBYJXJJB9q0VDAjbkQM m5N3OYdKvUNzpkK0LHVKhEgiW3Ukdcv4vjNOunDGjJJAod/A+u22uJIp2LUdXxOXJn9j s0FBXXoEVtSIRUwT4Gapu14HiW+ppghz+GeWt6cVuINXlBrSNi1FOZPGRvm6xCEJEqTj KeWjzRYgaHQK4DJAVvrvts9I5a/QrQ7DZHbz2R5+P6K4QTjSM8TKesEoWhT2op4l6VG8 Pyqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701909423; x=1702514223; 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=ku2sfUBBqRmjOusEjPPKSg3scPnZYVUEi+HsErMF7+A=; b=dn6dV0tz9LUDnmYmgsQH/KvI+llHdyeHO2iKMI4WYSM1EkXzmSQcXt8qTzSiOFRm1S P0ernsh54DxbMbZhKGM7vakEHrhj9JF34CfLffM5gutZj4+hRf+AMmTuIIcooDS6wZ2c gUbdM9XppVtKl8Y+WfX+x+UYYiZ8Ph1RvV+VsH2jxP9xfFvvsQlrCNErrDA3h8hZp1ZG 63puWUEuk5Iq1X5W2vNcCJ7sCjTzOsg8/1/xZgZ6Gi/uYn6eUgQ9rfpouWsHj11ZoE5x zv7RqzybZpwMQp+DfyXo2OO3/QPwhM9eDbrU4CMFEI8GneNJRBdguCOL8qSgoCsXkK1t pslw== X-Gm-Message-State: AOJu0YxjBcjBqXMfIpQwVZtGtUWT58q8vXFaP2VbW36dmaQxu+2N7qEf 57M46bNFD7J84bb2wUgc9t/xUHjZa0bGCpuA/hgB X-Received: by 2002:a25:7714:0:b0:db7:8141:e65b with SMTP id s20-20020a257714000000b00db78141e65bmr1716451ybc.64.1701909423446; Wed, 06 Dec 2023 16:37:03 -0800 (PST) MIME-Version: 1.0 References: <20231206060629.2827226-1-david@fromorbit.com> <20231206060629.2827226-6-david@fromorbit.com> In-Reply-To: From: Paul Moore Date: Wed, 6 Dec 2023 19:36:52 -0500 Message-ID: Subject: Re: [PATCH 05/11] selinux: use dlist for isec inode list To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-cachefs@redhat.com, dhowells@redhat.com, gfs2@lists.linux.dev, dm-devel@lists.linux.dev, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 16:37:22 -0800 (PST) On Wed, Dec 6, 2023 at 6:04=E2=80=AFPM Dave Chinner w= rote: > On Wed, Dec 06, 2023 at 04:52:42PM -0500, Paul Moore wrote: > > On Wed, Dec 6, 2023 at 1:07=E2=80=AFAM Dave Chinner wrote: > > > > > > From: Dave Chinner > > > > > > Because it's a horrible point of lock contention under heavily > > > concurrent directory traversals... > > > > > > - 12.14% d_instantiate > > > - 12.06% security_d_instantiate > > > - 12.13% selinux_d_instantiate > > > - 12.16% inode_doinit_with_dentry > > > - 15.45% _raw_spin_lock > > > - do_raw_spin_lock > > > 14.68% __pv_queued_spin_lock_slowpath > > > > > > > > > Signed-off-by: Dave Chinner > > > --- > > > include/linux/dlock-list.h | 9 ++++ > > > security/selinux/hooks.c | 72 +++++++++++++++--------------= -- > > > security/selinux/include/objsec.h | 6 +-- > > > 3 files changed, 47 insertions(+), 40 deletions(-) > > > > In the cover letter you talk about testing, but I didn't see any > > mention of testing with SELinux enabled. Given the lock contention > > stats in the description above I'm going to assume you did test this > > and pass along my ACK, but if you haven't tested the changes below > > please do before sending this anywhere important. > > AFAIA, I've been testing with selinux enabled - I'm trying to run > these tests in an environment as close to typical production systems > as possible and that means selinux needs to be enabled. > > As such, all the fstests and perf testing has been done with selinux > in permissive mode using "-o context=3Dsystem_u:object_r:root_t:s0" as > the default context for the mount. > > I see this sort of thing in the profiles: > > - 87.13% path_lookupat > - 86.46% walk_component > - 84.20% lookup_slow > - 84.05% __lookup_slow > - 80.81% xfs_vn_lookup > - 77.84% xfs_lookup > .... > - 2.91% d_splice_alias > - 1.52% security_d_instantiate > - 1.50% selinux_d_instantiate > - 1.47% inode_doinit_with_dentry > - 0.83% inode_doinit_use_xattr > 0.52% __vfs_getxattr > > Which tells me that selinux is definitely doing -something- on every > inode being instantiated, so I'm pretty sure the security and > selinux paths are getting exercised... That's great, thanks for the confirmation. FWIW, for these patches it doesn't really matter if the system is in enforcing or permissive mode, or what label you use, the important bit is that you've got a system with SELinux enabled in the kernel and you have a reasonable policy loaded. --=20 paul-moore.com