Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp915855lqs; Fri, 14 Jun 2024 09:09:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdd6b+jYDvwdgFWB6PwVsLzcdlRNB7FFqOIzDH1Pkb8ACmiVwf7PPSuvrJgTKSXEo1tDOuGQsXr3Sz1RqQnTk4+GwB32SWbCkAvbgSZg== X-Google-Smtp-Source: AGHT+IFIarMQEkQ7HqB6e7ZATW7zHidjGcgei7py5O4w4/onBIppmC8Mpm0/0X2/YUh04wGZNC8x X-Received: by 2002:ac8:7fc8:0:b0:43a:bee9:ebc with SMTP id d75a77b69052e-4421605877cmr59475621cf.19.1718381372974; Fri, 14 Jun 2024 09:09:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718381372; cv=pass; d=google.com; s=arc-20160816; b=Wo5TN0ztzjhKCwhFe3hdEIvH/YrKazhZSU0c8rHjfbGLoeOpnhncoMI6wKjc/R4CaD W105Vi8wsNCbSb8RyxUw477murMZ72noB95QJOzzXNFPh6RzXyPsYU4TEQjoQSf4dc6s NWVUKB+j67k1WDCrPxMTX+eT5sULjhgprG+OgCGUxReA1nE3t65A7opuTZektDpYJjCl fL1D9zCnTLfAedIF13SQk8M15pQewvwNqXyMey/SwokHDImzdSdMpFlvvztqUREUAgr1 lxORL0fw4B2GgPnhPA53VgMtIgdHlK9GIWJB9C3lI8CQmmsnBE/qA6PdLFmTtO5bZzAx T9eA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=75jJ5kZXzoFPiE5yRf33dYqfYhEcp5r3rjNGFEKSqIU=; fh=g8QqGHOWWm4utLeC66qTu1fvtAi2WK8UyNYLFnjVwKI=; b=I+ZISGK0gwtT5v3dmPZOEclGzDkM5g29azrtCDi4LsfAOovLVdWf+iTQA55UZfxz8p WFSsRp/0Hfp8Kc3PJm+a4U2HaZbVSIRMtSpys4L8aI+yutmkB7Dl7ydTb1mM/lK3ouK6 5DyNcXwPIlOskFFKZsKng26AQoJy4PwAPUhmzi+3N00xXlT/5PLxh61JXwlWhCP2VGCT Wj0qXnc0ieBZIAY7/bXOMen2R5zwCaiD/kqdTMlzfpVuQz4tdqMQsPQMKtcffcV/lWBZ O4axofwJSNNnQXa40Uy+x4Y1J39XRaqd0BVnctkkge65LIGm25cV6HAxlRiKZ6c2Ez7I S0Aw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kp0vLtz+; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-215199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441f30f8b18si45505781cf.702.2024.06.14.09.09.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 09:09:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kp0vLtz+; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-215199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 54B6E1C24E2F for ; Fri, 14 Jun 2024 16:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 247C8180A79; Fri, 14 Jun 2024 16:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kp0vLtz+" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 B0CD717FAA4; Fri, 14 Jun 2024 16:08:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718381333; cv=none; b=TE9kg3rzaz7ebdqj3JJSvQSC4t7XN27kF1AhiscnIwJ+edoSKg3TDNpxNW2Ftdn5yPJ13fqgPR0tKcxoUbUHvKncw9AWARkeytmAQ6q5i9WWkr6gZKyqWyoZJuAWlJwVxyDdeJ4aFZoE70F4u/7xZEhJJ3cZkG5W7Q71JAhO1nc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718381333; c=relaxed/simple; bh=sQjq5cGXIM+nx/P/Mig6SyDdYfM1cXqaGAJW8hcFpKI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ITSrx6R77KK6mprZbOWN4l/94KOZo5a8Vur3AlecLBwVfxKqJlRUfjqQJz3kjKJG5bCSNpYqf50bFWqEYJA/HvdCGIN8vgA3iN4IGdT006EaincXmFmGhh/CrUQitT/xhn9RVI3RRc6ieQQYmwVBxxf6i2TXr0TM8EPTcln+sMI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kp0vLtz+; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718381332; x=1749917332; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=sQjq5cGXIM+nx/P/Mig6SyDdYfM1cXqaGAJW8hcFpKI=; b=kp0vLtz+Ap3oPbgg7a7YmczDSSmbVADF+D1PDAJlo82rP7maxZzblaxh bvxAf+N0bGwHIL33W+mDjOHPhKon+iI8EkdL5DXJa+MWl9SFAodC2Zi2I 0DzGm3CbdLq9ha2QZL6mmPXzjPQAK5VR04B+ywT+3tUnCaKaTyI5OETJs kyaATRy/2o74n4rZ4McVQGbDIP/9oj1UNA+N7rzfCbS7xXRFwT3iJXjDZ yYOWeXl4Hqbrt9xEDTTFsVWBsgydiEZbUswLWg8Q1R0J5UDICQn1IiDq1 vI6eXtDJg6BvpsCic7iZVv5tcI9YWK53d0WplorsCF3WIdtyeCbj4GFNk Q==; X-CSE-ConnectionGUID: dIWO97gJTJWuGQh36WuJRQ== X-CSE-MsgGUID: e0xN0nQJRY2fn9ivid6Azg== X-IronPort-AV: E=McAfee;i="6700,10204,11103"; a="15399364" X-IronPort-AV: E=Sophos;i="6.08,238,1712646000"; d="scan'208";a="15399364" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 09:08:51 -0700 X-CSE-ConnectionGUID: T1J/wmeNRcmCOJl+EGfp1w== X-CSE-MsgGUID: d9hRaR+GSBebOghidcSQJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,238,1712646000"; d="scan'208";a="71741068" Received: from linux-pnp-server-16.sh.intel.com ([10.239.177.152]) by fmviesa001.fm.intel.com with ESMTP; 14 Jun 2024 09:08:48 -0700 From: Yu Ma To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, tim.c.chen@intel.com, pan.deng@intel.com, tianyou.li@intel.com, yu.ma@intel.com Subject: [PATCH 0/3] fs/file.c: optimize the critical section of Date: Fri, 14 Jun 2024 12:34:13 -0400 Message-ID: <20240614163416.728752-1-yu.ma@intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit pts/blogbench-1.1.0 is a benchmark designed to replicate the load of a real-world busy file server by multiple threads of random reads, writes, and rewrites. When running default configuration with multiple parallel threads, hot spin lock contention is observed from alloc_fd(), file_closed_fd() and put_unused_fd() around file_lock. These 3 patches are created to reduce the critical section of file_lock in alloc_fd() and close_fd(). As a result, pts/blogbench-1.1.0 has been improved by 32% for read and 15% for write with over 30% kernel cycles reduced on ICX 160 cores configuration with v6.8-rc6. Yu Ma (3): fs/file.c: add fast path in alloc_fd() fs/file.c: conditionally clear full_fds fs/file.c: move sanity_check from alloc_fd() to put_unused_fd() fs/file.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) -- 2.43.0