From patchwork Thu Oct 29 18:43:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 7520151 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B1FCB9F327 for ; Thu, 29 Oct 2015 18:44:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCA852084B for ; Thu, 29 Oct 2015 18:44:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDFBF20849 for ; Thu, 29 Oct 2015 18:44:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756825AbbJ2SoI (ORCPT ); Thu, 29 Oct 2015 14:44:08 -0400 Received: from mail-ob0-f177.google.com ([209.85.214.177]:35753 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752025AbbJ2SoG (ORCPT ); Thu, 29 Oct 2015 14:44:06 -0400 Received: by obctp1 with SMTP id tp1so24950375obc.2 for ; Thu, 29 Oct 2015 11:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:user-agent:mime-version :content-type; bh=jB6ws+sRSVqz9un+wOtC4BSnl/fIGcJp9Fw2BB3iE00=; b=ASLRPxYdo+PtUv7Ls6uwdpM9EE1UTsb/rIUKDy4hDKrceakEVVkSXHZYfd0rnIArae tFYiRxhUTYMacTWMC7XIciC3x7U+V5xjohXSZkqAW7tCZm1kg6Z5W66AfwShH1FXWxXJ 3roLOBtAcCe/oUQFWhF2yoTLm9OILl3yNHV4mOViWUxQVE5HBm32BYUz40FP16Js2PDC MwGwKoF55StkdCvFTSEj84b6J8wDHoWLShSDVDwKRjFNHsz9RhbpsTrK9o08kP/5L0VZ 4kM7cQDV6P2jnQoe/JIv9wmwb9oviSJjRNB/kq6SNRfmNAHJK0f472/nn86lBXI8MVyy WK9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version:content-type; bh=jB6ws+sRSVqz9un+wOtC4BSnl/fIGcJp9Fw2BB3iE00=; b=WbC3GJrFyVT/+3I+wiRE4/CpKf8b6zDi75AcwJyyAQ0anGGywdaU7oDvCIAH4QW2K5 WRfB1yxC8fnpLVEiC22JU2QNimcpO6rZx0qRxQtyHMg9Y7CNP8B9LMg1Y1G1vkkEDV3q QqVji3X6UpDbMOVM48MoQ1p2XmfMoFxoxk25+BeEv0zrKJlDbQrlPqK+y/8jpgw41dwY AZOKu6cHPl8q842N14hV0NryVwIsVE7pBZZiHjtf4uPMz6LpBXT237bU5ojqaJi8/0cx H2CFx/XIxCExCqwTyV6k1uMLvAykk0kdFeGl5qV5sfRulw4jrmvLZVzulufXii4wJdnd lmKA== X-Gm-Message-State: ALoCoQmYjFpeSRMH9CbkHtD3FlvAlhvcbbjgnsPxoPp+mzKjxfoTMn33oionc7s+bnsg0EXgGVBL X-Received: by 10.182.74.226 with SMTP id x2mr2473986obv.87.1446144244925; Thu, 29 Oct 2015 11:44:04 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id o185sm1074714oif.14.2015.10.29.11.44.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 11:44:04 -0700 (PDT) Date: Thu, 29 Oct 2015 11:43:56 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Boaz Harrosh cc: Andrew Morton , Benny Halevy , Trond Myklebust , Christoph Lameter , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, osd-dev@open-osd.org Subject: [PATCH] osd fs: __r4w_get_page rely on PageUptodate for uptodate Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Patch "mm: migrate dirty page without clear_page_dirty_for_io etc", presently staged in mmotm and linux-next, simplifies the migration of a PageDirty pagecache page: one stat needs moving from zone to zone and that's about all. It's convenient and safest for it to shift the PageDirty bit from old page to new, just before updating the zone stats: before copying data and marking the new PageUptodate. This is all done while both pages are isolated and locked, just as before; and just as before, there's a moment when the new page is visible in the radix_tree, but not yet PageUptodate. What's new is that it may now be briefly visible as PageDirty before it is PageUptodate. When I scoured the tree to see if this could cause a problem anywhere, the only places I found were in two similar functions __r4w_get_page(): which look up a page with find_get_page() (not using page lock), then claim it's uptodate if it's PageDirty or PageWriteback or PageUptodate. I'm not sure whether that was right before, but now it might be wrong (on rare occasions): only claim the page is uptodate if PageUptodate. Or perhaps the page in question could never be migratable anyway? Signed-off-by: Hugh Dickins --- fs/exofs/inode.c | 5 +---- fs/nfs/objlayout/objio_osd.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 4.3-next/fs/exofs/inode.c 2015-08-30 11:34:09.000000000 -0700 +++ linux/fs/exofs/inode.c 2015-10-28 16:55:18.795554294 -0700 @@ -592,10 +592,7 @@ static struct page *__r4w_get_page(void } unlock_page(page); } - if (PageDirty(page) || PageWriteback(page)) - *uptodate = true; - else - *uptodate = PageUptodate(page); + *uptodate = PageUptodate(page); EXOFS_DBGMSG2("index=0x%lx uptodate=%d\n", index, *uptodate); return page; } else { --- 4.3-next/fs/nfs/objlayout/objio_osd.c 2015-10-21 18:35:07.620645439 -0700 +++ linux/fs/nfs/objlayout/objio_osd.c 2015-10-28 16:53:55.083686639 -0700 @@ -476,10 +476,7 @@ static struct page *__r4w_get_page(void } unlock_page(page); } - if (PageDirty(page) || PageWriteback(page)) - *uptodate = true; - else - *uptodate = PageUptodate(page); + *uptodate = PageUptodate(page); dprintk("%s: index=0x%lx uptodate=%d\n", __func__, index, *uptodate); return page; }