From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 7CDDC2D3750 for ; Wed, 10 Jun 2026 13:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098640; cv=none; b=UpE7IfG0TKAFT9WVJ6c6VQ5tzfUX9N/SmuqvPrUFYJmGVzPfMM+sWHwKjQSNgKxH5bnPIeCUyn6meZm9rayhOOrqetFYGi7ln5YvOynOT2dyHtvx5N9eYVUAvrb5XnhOmN+hUilKyRxvNEeoAcCQl6VmxyWzXdU82zd1rksnqNM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781098640; c=relaxed/simple; bh=MZe7fVWYI52TMx64RXHXnMVqqQJFh0G4QoSu4aR/3Ro=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=i9t8A868mPYKzLv/U/0WNy93ouI78G7HWrELCtU7R1JfZBXmbLfIQ78DaixkrxOauMTZ1/YFytOEWWPlBI3BjnKo9qKfTXzIHGEJjJPJZgDeiEK71OQf+b+8ONRiDOSah1P3x2q+CcXSpETxuIui03HEBJBSxwuRpPoCdbwQ0dg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OfP1v3zt; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OfP1v3zt" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-36bb3551f6eso5997292a91.1 for ; Wed, 10 Jun 2026 06:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781098637; x=1781703437; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=90h3yfMHqb42RZxN8blv91V7/w7mF3MH29nWpUNYRUA=; b=OfP1v3ztnWNSEQu5c3cx1bic82IELcbahhv1T6l+rBkOFTL4ylSr1P1x/treHaNxAM OjxPX5VbNovE2eER1UTHKDLdffcoBKdJ1j8rGaVorthJAOwaTUMpZZteZz1y3QxfONt4 EcOV8uQADWnDzgmsxL806XC7cF67W4Xh88gXZ+O/00hlOszHfut6i9uyIugTUoUa1k0a oBkqsx5MqEscRzvpdE63o3mio/UlA4fGMap5FCVezC2BnaONV1Om2pBNGRgx14wr7YV5 GyC1KwaeIKD6Zp5egYFrwtlTAHR4c3PmjxvZyWaF1lwwFDVYQcd77cNLr6DkHqWyHSXs OLfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781098637; x=1781703437; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=90h3yfMHqb42RZxN8blv91V7/w7mF3MH29nWpUNYRUA=; b=fM46xC/1uuJwtCDrmwxHrDCP2ExkgejMIqpowVyWv/cML6LQi9ShzhmtiVP7t3QySX XN5FP2Ljfx9TYji1g3Keu/ASU/dZMDydmjH3PCk4PbfcDV/TpSviCM4hqYvMy0IIXuJ8 Jh8b3gFKhmn0nI4m7K44t2JhqFayGml3MCtq/3lazg88ydkWIVaGUrd/cdm+rUf64aD/ Clkc+TPKEALRn0mBouq1oFp/AgttaD4qLBV8S3kkAAgWffizxZGtYmOObdE1zprdY012 qrd/K9xWd24haQAwNbcPuF/MwgREBSYzhM8aLJ8HoXOO7PsPjsJ8cSHf5uwS0JVHOlEe Xqqg== X-Forwarded-Encrypted: i=1; AFNElJ+q8GbP4ZM4GbM3LHubNzJyVN0O24AFMvYa0ugO7QvoS7GxDbUiqHXjfPmcidIpVmipJtFVMHpFBNh+PQU=@vger.kernel.org X-Gm-Message-State: AOJu0YwG1CwITp6lERsZV1868UigPjZKl4cnygmrZWAJxlaYPAuF8IU2 fF9HjpTCiafrEizywj+Dr8Pb6W9QEqnkvqv9dkMzrH+ckuCWW2B6ZARj0BgKptKmiqg= X-Gm-Gg: Acq92OHWk34gT2D0e4NYT4yloMvZfPQ4LGNTQGTKPf6g8Ps9AJ8D+Z8qo+4o8HCG0y6 ipKmeIhpXvBslw/zBWnJtTDutLbkB2a4iHQj5GPDBw57Faxt6qE4DxbpMW0xPetwdWkN9JT30Ag dziVCjIKkwEkfU0IUWDPxBDeNLlIR6JZ9/TX5n8P5qAP4LvSFS/BK8PnzGJSXHBX2tevZ731Uyg j44WOGbt78Q2nKcs5r5HQaqScHDTKVRBZtA6V3tznhp+IRj+H7ow+ZN9Ok5+Gf8oB4xwWMoAYxd Ed5YOR9LBQHlUT9slwhsg20g6HW5syBNUCiKEkHs8O/iy6UXJRycTQghguf8n9FobOMrIBHdutB jBL3D9HCEVa6HWPaqTwKDSwgpPeu+toMano4lZ2QKeSAqEote+57BFLRDX928751JDfUe5zLRIb 5NTSORQZ93dZdcKYUMSUmT0HsPLn1YuMFmkqO4/+feJRzFroMMEvjYvmAKWg== X-Received: by 2002:a17:903:248:b0:2c1:564b:4f49 with SMTP id d9443c01a7336-2c1e7b35a10mr283910915ad.6.1781098636645; Wed, 10 Jun 2026 06:37:16 -0700 (PDT) Received: from localhost.localdomain ([47.100.192.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f890b2sm248130815ad.26.2026.06.10.06.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 06:37:16 -0700 (PDT) From: Yang Wen To: linkinjeon@kernel.org, sj1557.seo@samsung.com Cc: yuezhang.mo@sony.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Wen Subject: [PATCH 0/2] reduce directory scans during file creation Date: Wed, 10 Jun 2026 21:36:56 +0800 Message-Id: <20260610133658.196180-1-anmuxixixi@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Creating files in a large exfat directory may require repeated linear directory scans. First, a negative dentry obtained by an existence check is currently invalidated for LOOKUP_CREATE. The subsequent create operation therefore looks up the same name again, even though exfat does not generate FAT-style 8.3 aliases. Second, after an empty-entry hint is used successfully, the remaining contiguous empty entries are not retained for the next create operation. This can cause subsequent operations to rediscover available directory space. This series makes the following changes: 1. Reuse a valid negative dentry for LOOKUP_CREATE when the parent directory version has not changed. 2. Advance and preserve the empty-entry hint after directory entries have been allocated. In a test creating 20,000 files with random names and sizes between 1 KiB and 4 KiB in one directory, the elapsed time changed as follows: Before: 3879 seconds After: 3050 seconds Yang Wen (2): exfat: reuse valid negative dentries for file creation preserve the next empty-entry hint after allocation fs/exfat/namei.c | 56 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 9 deletions(-) -- 2.34.1