Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp871574pxa; Sat, 1 Aug 2020 08:40:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWRqvX/X0zU/sO/WZTDVgz6XnANAwtuH+16KrO0zgc1O1qpQ+7UcCT+tymDGw6qkHyUFEp X-Received: by 2002:a05:6402:403:: with SMTP id q3mr3359849edv.12.1596296421536; Sat, 01 Aug 2020 08:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596296421; cv=none; d=google.com; s=arc-20160816; b=up8FvW61jOVDGEZ3bPJLs4QXZ2Xdmq1gRVEMaY4NAKfuws3VxzSVoPax9Vtji6p7Pi mbxTeSz6ayrLIkOV/Roi48RraWdxRJfdFkuZnW0a9Drrlrq+qctCutL+gRAZxNse5gzP ISQqpNHvqiiTPMgZWiB8/QnmVdEFfHjfwQSWYn2jqBRZWuzgzBwych15qk3Lvmtm8g0A EHZG4kLI83KxrVCX241AKP9XUDLMPaWVP9zTb1FvPJfwy6RNoj+/6cmxyzqRKCcbwvJy db22HqpbIB306nn0RozMGDgWo+/5ya/OSMOqyyRoNkrkIZfjjL+DWlKuEp60y2DwuDhH aOpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=yI7TX5klAseKr0Z3D3BS8xEKHJ+ORcK03f7IAlX4iJU=; b=HP+YeoyLgLBWs3p8XeegUEf/yX273wRNF+XwqKjHYXRotw1IXkXG2eaPVNg+JYn5zs XtH+abbTTCP7Bg1NAb91IaimdqddOCcwcnR01Sue6sJOiG+7hOAHqEEsj3mNvwrZPvG8 oqMjjwxYpFJBnlCJldYCm7GFcjopV0hoG1a5r4r2//3mDm2RBjrJWkNHbQh3IG1Vwb8B WxhKwsVjQCdMeyCqrWb/Rt1DYoOVGw8QzPODiUAR5gjGqKjisIBP+R/tfLl4XVj3FdYk 0kueysgFqI8ypvVznHXXS57E+or3nVPmJk7B3GhdOAm1ciVyRLacuqbhl+omcAI+tefs wKjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=dSY5QXHa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si7215064ejz.138.2020.08.01.08.39.58; Sat, 01 Aug 2020 08:40:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=dSY5QXHa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgHAPhQ (ORCPT + 99 others); Sat, 1 Aug 2020 11:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725841AbgHAPhP (ORCPT ); Sat, 1 Aug 2020 11:37:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86674C06174A; Sat, 1 Aug 2020 08:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=yI7TX5klAseKr0Z3D3BS8xEKHJ+ORcK03f7IAlX4iJU=; b=dSY5QXHatS2DCto5C80rS/BTwQ r59sRNJL3/z73ZC2XXhgHHXFhGGnxhCdtCXqiYHlYeQTGIuERgE4x9FjlpxN+Zjo0jOHHjFwrDf7o KmcY4X/Ko7sAbiXgsJkHu3p4M2+FseQ8XBNYeBxPgjyoFLKhW/QA40DaA4MreUshLgoLzR15NWRVp F3V9QM/eUfURIKoXUaF8KBH88NSOHQ+wgqLRNpVwBel1qrVFdH3YV/SQs0pHxt1fLuKMR76TKD5HH hAV5YaL+0F8AIU1cnL9OZYvDuBBMCkAZPXvdpM3pkU+so/aW7B0OO0EWTxm+TdmBS84Rt1C4lP3sT EWUe8Gzw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1tZP-0004jB-U1; Sat, 01 Aug 2020 15:37:11 +0000 Date: Sat, 1 Aug 2020 16:37:11 +0100 From: Matthew Wilcox To: Pavel Begunkov Cc: Jens Axboe , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: optimise kiocb_set_rw_flags() Message-ID: <20200801153711.GV23808@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 01, 2020 at 01:36:33PM +0300, Pavel Begunkov wrote: > Use a local var to collect flags in kiocb_set_rw_flags(). That spares > some memory writes and allows to replace most of the jumps with MOVEcc. > > Signed-off-by: Pavel Begunkov Reviewed-by: Matthew Wilcox (Oracle) If you want to improve the codegen here further, I would suggest that renumbering the IOCB flags to match the RWF flags would lead to better codegen (can't do it the other way around; RWF flags are userspace ABI, IOCB flags are not). iocb_flags() probably doesn't get any worse because the IOCB_ flags don't have the same numbers as the O_ bits (which differ by arch anyway).