Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp1618315imb; Sun, 3 Mar 2019 00:22:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IbMU6rS059KujWG5DAxkI1W1mQPtZxETDaltwaSZniM9NNCf/KV35SaJbKgYaXweS1gVGtS X-Received: by 2002:a62:489d:: with SMTP id q29mr14110240pfi.119.1551601369152; Sun, 03 Mar 2019 00:22:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551601369; cv=none; d=google.com; s=arc-20160816; b=JVlz7gRLZdTdqYxg20r9J6HwHb9oyyYvUtaecMY8H35eMnAyoZP/FWNDRHbDebGLKl Zr2pCvZBkB5QczrxYyaOO17FsBtKbnl2rImmNyiDZ5N5gAiVWl215j1wCiB0tL/c/p1p OOanquYwKa7DiyUZ7Tm5k8LkHVd+b20gEMU0KfNyrnx1+xCidQEdqVeo1NVMlny9qQ9F y+y79+NQ9saNqnVwWcHB9Z00nn9TuncZCOGKjHA82ffYb5yxecWrhAFmGEHokMxasq73 f7Me9SIA0G1lI7glCgP4dKrb4eNFr527OBsCRWaeqoIm1zV3t4nBKzduX7/OAKIrJVWw K1HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=qKxF3w0bzz+M2GvWfP/a8wvnNvwqxjOwbZ59SmD+8dw=; b=yNfSkgP6KhkhA9M4nRQGnyDmbJpIEb/xiVUXvbh760IGbuJNoeqGbR+nWDbX419wKQ CPVWtMG/AyvKDbSPM9EOjRgSdbStOiZeETFvTPvNGR6NPESzZxOTitGX8z7FMcYs0nRM aVs8UCnr/TR1RPwmuy0grYhtDOBSwGi7EvNVafKPXJZ0b+Wk1FHmuAb3KyTql7NAVl+e Q0wabt/qxvDSIPnGulth/3and6qEREBSQD4W2MGJtdqOb0++JWN364iomRRHCrmCzEUl xVa6ZcWVzc51zJ/eq4jF7lZKdHBN91vzLUUvyXCB/FJO1Vodh6zhqm5C4LY4jrHxurs2 3RdA== ARC-Authentication-Results: i=1; mx.google.com; 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 98si2581732pls.258.2019.03.03.00.22.33; Sun, 03 Mar 2019 00:22:49 -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; 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 S1725985AbfCCIWO (ORCPT + 99 others); Sun, 3 Mar 2019 03:22:14 -0500 Received: from smtprz15.163.net ([106.3.154.248]:56466 "EHLO smtp.tom.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725923AbfCCIWO (ORCPT ); Sun, 3 Mar 2019 03:22:14 -0500 Received: from 172.25.16.148 (unknown [172.25.16.148]) by freemail01.tom.com (Postfix) with ESMTP id DB65E1C81A29 for ; Sun, 3 Mar 2019 13:00:13 +0800 (CST) Received: from 172.25.16.90 (HELO smtp.tom.com) ([172.25.16.90]) by localhost (TOM SMTP Server) with SMTP ID -206394238 for ; Sun, 03 Mar 2019 13:00:13 +0800 (CST) Received: from antispam1.tom.com (unknown [172.25.16.55]) by freemail01.tom.com (Postfix) with ESMTP id 25A2A1C81A26 for ; Sun, 3 Mar 2019 13:00:13 +0800 (CST) Received: from antispam1.tom.com (antispam1.tom.com [127.0.0.1]) by antispam1.tom.com (Postfix) with ESMTP id 19F7F1000E33 for ; Sun, 3 Mar 2019 13:00:13 +0800 (CST) X-Virus-Scanned: Debian amavisd-new at antispam1.tom.com Received: from antispam1.tom.com ([127.0.0.1]) by antispam1.tom.com (antispam1.tom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PimPz40B2Qgn for ; Sun, 3 Mar 2019 13:00:12 +0800 (CST) Received: from localhost (unknown [110.184.153.41]) by antispam1.tom.com (Postfix) with ESMTPA id C24C51000E2C; Sun, 3 Mar 2019 13:00:11 +0800 (CST) From: Liu Xiang To: linux-ext4@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, Liu Xiang Subject: [PATCH] ext4: do prefetchw while the page pointer has been updated Date: Sun, 3 Mar 2019 13:00:07 +0800 Message-Id: <1551589207-3774-1-git-send-email-liu.xiang6@zte.com.cn> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When pages is not NULL, prefetchw(&page->flags) always works on the last consumed page. This might do little improvment for handling current page. It is better to do prefetchw while the page pointer has just been updated. Signed-off-by: Liu Xiang --- fs/ext4/readpage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ext4/readpage.c b/fs/ext4/readpage.c index 6aa282e..0b68dbe 100644 --- a/fs/ext4/readpage.c +++ b/fs/ext4/readpage.c @@ -126,14 +126,17 @@ int ext4_mpage_readpages(struct address_space *mapping, int fully_mapped = 1; unsigned first_hole = blocks_per_page; - prefetchw(&page->flags); if (pages) { page = lru_to_page(pages); + + prefetchw(&page->flags); list_del(&page->lru); if (add_to_page_cache_lru(page, mapping, page->index, readahead_gfp_mask(mapping))) goto next_page; - } + } else + prefetchw(&page->flags); + if (page_has_buffers(page)) goto confused; -- 1.9.1