From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 27A6B31A065 for ; Thu, 9 Apr 2026 18:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775761190; cv=none; b=PXzDadf7lpK6PkFlI+9E4sJVL5FVJ3WcnpxdmpxDfIqAvrT1fw1mdcJzJ2BSbWRWWcmOzjba53+c3vRdbucK5VDOYAmUXkVwLy6xvb+INCjAyDX4JitOPHwvBaz4Z7NSWT0g82ghZh9+O0FV13TQIaCUCN/oFsXPKn1sK4RPPKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775761190; c=relaxed/simple; bh=YDfCbSOCT/VePpsM1GCJR3KRmd3LAmnBBqwVegZalRw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a/Ybx5YuQ7BvJCo3T3ZEWLjA2pfZxZMdbg8v+YoVsPwcjqoL109hvadTc6hHHILMDwWkCYCJ8iU3STZ7uOR2uOscaM8/MD3xzwT/3DxqAQS+0xqnmmXbbzKYIZYTPLpw6TmCaeaVyzcD0LpB8khQZnVSFdeJ/W5URBB0PY1yavM= 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=MzboGKm9; arc=none smtp.client-ip=209.85.128.51 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="MzboGKm9" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-482f454be5bso13392175e9.0 for ; Thu, 09 Apr 2026 11:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775761187; x=1776365987; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=tMFVvLT6MGeXYI6XAT5Rr4C/KWhcYugpA/JpBgEF65Q=; b=MzboGKm9l2tVpCn1DgjpyQUHR+u+xvD0a8eQ0CxRpwvnYcafA1k4B5iHVQ4QV5cZxT qlCaEWCXFoDwDwXCTeCv7EluJ+gn8JJKagRNOrNDmc3WPkvZ0D+Fnq4s4UYeO9fYdJ06 ZEb1eTnM+/p0k3CaRsTyhvsvyF7yrtdFYo/dAY9ICvASHJprjO7yzgGl/Gt+D3ffdJor 2Nsry9r04ob/uLSYOKF4ENjg+P568ddAwmCGcDNTRHjzGsa423Jg2JX+oogIkGzVIiGa USWv89kf4AXC2MdVg612oYmSFLY/lvUch1SbYRGoDOnaLTRjBlP52HB2R9HB1g5vbnWq KGUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775761187; x=1776365987; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tMFVvLT6MGeXYI6XAT5Rr4C/KWhcYugpA/JpBgEF65Q=; b=fyvBfoLP4g0eRj8goLMhXYmKYO26v/3HvrbzX6kkCCUVyzuuVy+NI/+udBLl17IMLB /s6lm6qUwJvz8yhJRPzywjTWfr3H7s3xnkSUluNHI/bveXIosK/vgZC7NF9n6kGtHlST UZ8LG3dq0u6bsRSME+LnK1qr7Du3+yMbgl99XS3UrsSxoe5Xa7Kvy9o9MtsF8VIJWjnd F7RHNJxdRxEJShX1TbAsvKQVrCvq3SIHyHg4agJluPAt7YJUhwMoRv7jNfe3h3+IOx3c zQ8MRhR+fVWr9xD92GqyMY8JO+6vQ1Cg5c9F0gYo+NnoAkHjOXzNNAeyp5OnkIEH/no2 ikHw== X-Forwarded-Encrypted: i=1; AJvYcCWu6n7MjEGckxMPMXwdCBYgt3vyOhWD7fHfI9fTI3Mkdo2+zDL0HAvXEhNPiDuXQ4xAzl1HqUlwVA7UZR8=@vger.kernel.org X-Gm-Message-State: AOJu0YyeR/ZIcxVrcWeFTzc9E3ciP5tsZHD/Gal4ZQLAR9EP1sew2KZ+ MBpizOxJVLSURzqf85ujNuxmVMbnn90yTgTi4psZ4CdYw6HVn+BJGuVh X-Gm-Gg: AeBDies6uvMqEZRfGcbGd06QWvMmb6RjjTtJZyvDuYrWsYKcKI/cZycThc9nr+upney BM3mGGCq8zhOLJHMR7/bY2vNs6+Gu2bEnQGit1Wx0bNpNU9BMQJb37Qt06O406nqVWL2v2y3KRi tbeUpKyUwuF1AQzxQ81VEatj2G7JWkkqfaF2cSfGeWhUb/nsuGskYFvEit6GL17y6TeA4RM6Jdv MEv8pWKyrZ7S70J+M9bobKoOo6QcW4ODKK+4BdrPs8TQAD/TIe3QQZZO8FRFPocoO5361hwEIm1 WI7XV2zos4Jgpuk4S1zTt+6eyUAnMoAXyXje9R3vhiNYWB6RQFMGQBUB/4PGe/K/apuy4tPV0j8 ZPGSDLXSz7Fh+mx7IzDkOf+yw4Lhrha8oN77CzYNdNTe4UknBXoBDTH+4mmHgC+1vQh45nwOIc7 jaedRjl294MePF5SKBCn0hHMznOIk8Z/ENZGJ03K6fsOaSJalBGyGiMypgXWu+EuFu X-Received: by 2002:a05:600c:19cd:b0:488:c239:d498 with SMTP id 5b1f17b1804b1-488d68712d5mr286365e9.8.1775761187196; Thu, 09 Apr 2026 11:59:47 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488d53807d7sm26718395e9.10.2026.04.09.11.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2026 11:59:46 -0700 (PDT) Date: Thu, 9 Apr 2026 19:59:45 +0100 From: David Laight To: "Theodore Tso" Cc: Yu Kuai , adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ext4: align preallocation size to stripe width Message-ID: <20260409195945.76393a20@pumpkin> In-Reply-To: <20260409142911.GB59468@macsyma-wired.lan> References: <20251208083246.320965-1-yukuai@fnnas.com> <20251208083246.320965-3-yukuai@fnnas.com> <20260409142911.GB59468@macsyma-wired.lan> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Thu, 9 Apr 2026 10:29:11 -0400 "Theodore Tso" wrote: > On Mon, Dec 08, 2025 at 04:32:46PM +0800, Yu Kuai wrote: > > When stripe width (io_opt) is configured, align the predicted > > preallocation size to stripe boundaries. This ensures optimal I/O > > performance on RAID and other striped storage devices by avoiding > > partial stripe operations. > > > > The current implementation uses hardcoded size predictions (16KB, 32KB, > > 64KB, etc.) that are not stripe-aware. This causes physical block > > offsets on disk to be misaligned to stripe boundaries, leading to > > read-modify-write penalties on RAID arrays and reduced performance. > > > > This patch makes size prediction stripe-aware by using multiples of > > stripe size (1x, 2x, 4x, 8x, 16x, 32x) when s_stripe is set. > > Additionally, the start offset is aligned to stripe boundaries using > > rounddown(), which works correctly for both power-of-2 and non-power-of-2 > > stripe sizes. For devices without stripe configuration, the original > > behavior is preserved. > > ... > > Hi Yu, > > Did you see the build failures reported by the kernel build bot on the > i386[1] and arm[2] platforms? The problem appears to be using > roundup() and rounddown() on an unsigned long types. Looks like that whole condition chain should be replaced with something based on ilog2() (or some other bit-scan function). David > > [1] https://lore.kernel.org/r/202512102331.yweFnVTU-lkp@intel.com > [2] https://lore.kernel.org/r/202512120613.mM5COVWV-lkp@intel.com > > We can't apply your patch until this issue is addressed. > > Thanks, > > - Ted >