Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1187674rdb; Wed, 24 Jan 2024 07:25:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IHr4ZVuj8FMI59puEhdVIIXg0xLpu2/gVuVz4z1TtGVfjfn8ScVY9PvF9DNjMi2E62xTHeq X-Received: by 2002:a17:903:41ce:b0:1d7:3d6d:9004 with SMTP id u14-20020a17090341ce00b001d73d6d9004mr886288ple.47.1706109936145; Wed, 24 Jan 2024 07:25:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706109936; cv=pass; d=google.com; s=arc-20160816; b=lwTtjqbo+HicQANPJqwi/+qxLpbm/EdZLh1IGMn4FMD8szLm3Tarkx8+kfEfCC5Q4T RV3gPVG+KREP59qfnGGoWZJSLD+cs16+z2ye4kBUsKF2YQ8FNdK2dtMm/BW3kXJmv3Ig AsLgUvZBz1FFHDi+rNi17GrjpEQNn5XE8DRXN5WyhGPBa2agmQmLHs5jBUj40Qe7gYm/ DqW6xOBLH3yvnFowq+PhxbZyR9XRqsQX4DvltaIjQ3J2uP335TS3i0keD6cZcB5zL8uQ bfIlXTG7qEPwpMnHhO1wNTIzW02QAfneGh+W0YUqrBoJAx4c/GLIu5DcGjIPXT9UHkYK dFcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zTb49+HRTkONjJr6dq0mM73YlvBqEdBQETcTSKY63iw=; fh=4a42I4Ca6+Fk3aqvYzp/HGpZkU5FqtGgVpiLW38Ie0M=; b=r3wxNjJIeRWq+6D2e/eOCCtA+xFKNqt2V8DXXbFWJD8qq2W1hmir4zCVVjTIlA7asS 81K0PQFuW+GWW+8RAOjS8afIWNkdEN62Lf3bduFV5Bf0g8GRvIQ55GpMsJ/zHPobuuUf wVfmab3vE7IONb30j86Kf9BYtx5mekOYFrRe6J0ZEYWJWUU+fofcVnfTdaxQ4kjiHl6P lrrrp1RT7MlGjkmBFe39+5wEVpT6wLxYBgYu4GotRmLka0BweUHnasQBE3PrbSENxyjP Y+kjdfUPWaM3Cqylj3Rf2YmFlOJalz3JpJFGn9moLIu1tpTBk5hCuJ6iYi4tzPOy/k5k Z8KQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ur9PpaIU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n9-20020a1709026a8900b001d3a6cb519dsi11670929plk.543.2024.01.24.07.25.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:25:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ur9PpaIU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-37241-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37241-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id F299A284AB7 for ; Wed, 24 Jan 2024 15:22:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE24E7A707; Wed, 24 Jan 2024 15:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ur9PpaIU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 19C7A23C9 for ; Wed, 24 Jan 2024 15:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706109765; cv=none; b=W0mx9eJjwKUFcX4r870pFDDIVfht1FT4f/71LeXNLY12tNN8kTQZDwgYYa/B0NiE7xNs5xPmPq0iZsk/DCRYGafbiO/CAUFkG4kfdLzl95wPT2hVJVhTEJUBghZNqP5eoHLmx/TczgOMPhJ62ZENyIGCZw+kHv9wGmcHlHUUm4A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706109765; c=relaxed/simple; bh=/I/RVLhwzWSg4OYBfyNQJivQLrlc9TmnSoyx0fkPJjs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uojFqD+jRWcvjG1iuJkbhUvWyYN0KerjQ6cTMf5RGwwJMk0BDVqdSugvtMnTfYpgNkbXElM1Hm202dhiXMww1svPdre2ajNo3yayLLz9EAPoapce7q9CKTTvAWTPWNMrRXBHnNQGyZf006ZZZgKU9h3g4PagybeF3pDw1zo6H1Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ur9PpaIU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 395B2C433C7; Wed, 24 Jan 2024 15:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706109764; bh=/I/RVLhwzWSg4OYBfyNQJivQLrlc9TmnSoyx0fkPJjs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ur9PpaIUGlo1PFFVHccI7tRdpzJuXycTMnVze26mYM8xOYgQv9CTa2zylc0Mwvdhw Z1VWDGnCb2B2r9ZKhFHJVu4nsbyYNHuw95I94OjccjsuzbomoyN45Vaj5V3FqPMTC0 twFxyDVQrcGaJKYCrr7QGR+yJvBKIOFQEcdzKnBHTZ1e+ZFcr0rvLtFEu/US5BaFz2 rNiZg9LC6bjOnD6g73qDnLwYEynY/qXMcPMTysBu/mPNhMFhnvnXkUA0lSAr6GgRH1 kDzbaEE0M3iFsSP/a9AlxGGD3QWvacGL8+FW8UKAJklT6zA8vz4zz1uluZaFekxfRP i/usizHVXVv5g== Date: Wed, 24 Jan 2024 08:22:41 -0700 From: Keith Busch To: Jens Axboe Cc: LKML , Alexander Viro , Christian Brauner Subject: Re: [PATCH v2] iov_iter: streamline iovec/bvec alignment iteration Message-ID: References: <544b31f7-6d4b-42f5-a544-1420501f081f@kernel.dk> 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-Disposition: inline In-Reply-To: <544b31f7-6d4b-42f5-a544-1420501f081f@kernel.dk> On Tue, Jan 23, 2024 at 03:24:46PM -0700, Jens Axboe wrote: > Rewrite the alignment checking iterators for iovec and bvec to be easier > to read, and also significantly more compact in terms of generated code. > This saves 270 bytes of text on x86-64 for me (with clang-18) and 224 > bytes on arm64 (with gcc-13). > > In profiles, also saves a bit of time as well for the same workload: > > 0.81% -0.18% [kernel.vmlinux] [k] iov_iter_aligned_bvec > 0.48% -0.09% [kernel.vmlinux] [k] iov_iter_is_aligned > > which is a nice side benefit as well. Looks good Reviewed-by: Keith Busch