Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1549374imu; Sun, 18 Nov 2018 04:14:52 -0800 (PST) X-Google-Smtp-Source: AJdET5fC6fRK8P9WO8OlcuKKI3DbYt1AmjzggxXc1ljjyYGpVkhzZAlYJJkHwWeQSqV/drNRuMuq X-Received: by 2002:a17:902:9347:: with SMTP id g7-v6mr17416040plp.148.1542543292697; Sun, 18 Nov 2018 04:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542543292; cv=none; d=google.com; s=arc-20160816; b=QJfjcx4BmebEcK2GB2Zbiac2o39d0LZjdvjET/7AV/zbM5HW9fy4410nzrvOUXQNvF DXI+ER8W7RBiVNS/iRNedcsxx1PYyToRehtAzG3hIQOMUH/Oi+Hie/S9OtvfPaLDbcxL VwfGzuc+yv0WuG4+KHmdeDT42Lx67K2JcD3y3kFZ8Nx8d5brsvml1wGXzRfxEieNIPn3 AboKO0K3UHKeY4I/Kx0P2bGQBLUEeNmhH6MafrqPahHs3hPiCJ+vnDIrvDOZnSyrKW+Z j55pflT8J5uMTU07Xw9yG2ucz51G0gl3tyIswTN48jThOTG8Yp8zcCcJZJiif1n39JIP qU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8N2uwu2WwXKm7do23lFv47rcDmbHRiG2vYzjjyHjehg=; b=W4l8roons+HzXmIF1FY0wXBtXlPVyF6sSx9VpnOskAN6mvjIT/MgPKNpYNp9l8dRtc 0+cDAf56EPcvradsNB+hA/9OuxIsR0rZCVYFqplY60ZTZh4+F+Uj4N6BvTHHKz40GnEr 5LnluRb+f86Igh1KCLworhZRHXakmMe1RJpLQ+pN711B/XPKlcR7mZdqVPimruYAbZC2 2GktW55NWa14LhDcULCl798F1tp8Qc44m317F0Gzk8aYTaD62Y72atRnQrh8LLQLnsZc lkujZZoiI9DSPquPbYyIi4BOmhA3IfF+4k6jYLlsZN6Bt7F6bm23SwK72n2eisYkKu8u m+Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="cc4NBjl/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si37203119plk.174.2018.11.18.04.14.22; Sun, 18 Nov 2018 04:14:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="cc4NBjl/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726964AbeKRWdd (ORCPT + 99 others); Sun, 18 Nov 2018 17:33:33 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:33936 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbeKRWdd (ORCPT ); Sun, 18 Nov 2018 17:33:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8N2uwu2WwXKm7do23lFv47rcDmbHRiG2vYzjjyHjehg=; b=cc4NBjl/uy7TRdwBnxZywJdm3 W0jiYFYyjRvPuWzp3Twd26LsvmvUzdz2W3Q2eL3bhNc+KE+Lgo/4xRnSDpRtQKyYNZlotEOXoXl5X KYJY8i/tS9frWaSh8ci5oVobI/jYFrQhV7nXQLduTmY3AxF10ic71SEE788MfFaPUJciRnUH776ka b6NjqzMayjjMpSkXyL6xESDpMbmY/xnWanwVKU0+S6gUGyoWfYjWayJ2QBGUisS5lBBsWA7eyuyZJ vAa0tpuP6SOMosYmn9Ee3Sbtf4+eIwyEuy6hwVnivoef93O0EJTDS5sJ7EJO7UTiSwxEaVr7ZEy9K PRraEWNjA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gOLx0-0007eg-Dw; Sun, 18 Nov 2018 12:13:18 +0000 Date: Sun, 18 Nov 2018 04:13:18 -0800 From: Matthew Wilcox To: Yafang Shao Cc: akpm@linux-foundation.org, darrick.wong@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/filemap.c: minor optimization in write_iter file operation Message-ID: <20181118121318.GC7861@bombadil.infradead.org> References: <1542542538-11938-1-git-send-email-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1542542538-11938-1-git-send-email-laoar.shao@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 18, 2018 at 08:02:18PM +0800, Yafang Shao wrote: > This little adjustment on bitwise operation could make the code a little > faster. > As write_iter is used in lots of critical path, so this code change is > useful for performance. Did you check the before/after code generation with this patch applied? $ diff -u before.S after.S --- before.S 2018-11-18 07:11:48.031096768 -0500 +++ after.S 2018-11-18 07:11:36.883069103 -0500 @@ -1,5 +1,5 @@ -before.o: file format elf32-i386 +after.o: file format elf32-i386 Disassembly of section .text: with gcc 8.2.0, I see no difference, indicating that the compiler already makes this optimisation.