Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10523468ybi; Thu, 11 Jul 2019 06:41:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJnbNOrNgiREhz/Bf+rjA/g5o8LBBB8mrWxpX5N9BvQEuc5LNVW4rfVEMMz1q8jTXi7y+8 X-Received: by 2002:a17:90a:fa12:: with SMTP id cm18mr4933949pjb.137.1562852515174; Thu, 11 Jul 2019 06:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562852515; cv=none; d=google.com; s=arc-20160816; b=ZCCa+5bUS1i8dImm1DuwAuZAf2laHp+37B+lhpzWrSy/Qezp4LHlU6y1lVZARXBrix I4w4ViAjf35rQBzGrZbWJFDIItZ5fsX/Xc2Fk+QmC9zJWi2wobhxqjMVMIOeylv6FJsi LQfiO8B6YByvLmkKEcHLqG0SKzdHiqAoh/s5BuKNxsQAVJOJHpIpFsi4ZhFauRdjSvb1 iKVaau3k9FGW29hzoQJv/jDQxzNDnOiXCkZqCRn0/Q83oRFrv6/jYqk9OxuBTupViSuN 6NAg2mbmyA1o3G2lFxDPcGqWzrVcFREA1r+W4NdIGMuEwS8OXNpQU9APC2yYyHSy0MeW sWVQ== 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=qQDTG34nBen/nM9O8f+a+MBGBH0+G5+6en1FIsdsBzQ=; b=kbsMgD1tYM3eMFH035RjaJCUUZg7K5BW7jRbniaMR6P/WibymWDZ0XADY59QT6Zn2E O97bwc53qb9gzmPvdZpvfXoiJGC8lWhH766Ba0uDOFsQ1o3HuVlMhc3nDrRrbICThHts JBL0DJweF0SOQWD1qEHDnVFu46O2qBKa4Vf3AZl5fmtIeuUFsFk5hZ4flKH8kpaHTafN RKtn1ZtMnRUH1WVY221rgKsnWX3HCmbk6fJj7EEvOxWZVz4MkgPBy3tt8mg4yOU0DIEi z4gj8zmyIpNJDjrF/Zp+ugT/L0eV8ZnaTE1jNu+9WY0ydTpi4DrCShNOSjx56N2gVH3U x+4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=W+v4En8W; 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 p22si5271205pli.255.2019.07.11.06.41.39; Thu, 11 Jul 2019 06:41:55 -0700 (PDT) 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=W+v4En8W; 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 S1728506AbfGKN2j (ORCPT + 99 others); Thu, 11 Jul 2019 09:28:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49064 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727956AbfGKN2j (ORCPT ); Thu, 11 Jul 2019 09:28:39 -0400 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=qQDTG34nBen/nM9O8f+a+MBGBH0+G5+6en1FIsdsBzQ=; b=W+v4En8WpGKHHhb5uk9cn5YEj gMBk1sMls9oDVSUMnffjOdYoC42wy0L2mrdb8o+2nRCt3WJcfJWdpJmZdwFH7zES2pWupJCUFZdpd +I0ZEZ52/7VuJmRzXFkuCHrqNnocufRvwVqTWFL84Zv2FBGtFMXone6sHQPuWsD3NHowMNRs2z0f7 EEm1jKIO9RQ8O8rAIcVGKaJlZ7YjDe4dFqP6S38khRcqg/4f/fhU2/h5XGx35pJ4tyHd/WIhuiZAS fepWgCd+ombLf62ZVAnnAYieZTutsx+4AKG4jD7zCntmeAryEPk4KQ+vNqva9zXi8VGg4PP5+X3Ao VyIPQLmeg==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hlZ7k-0002ft-Fx; Thu, 11 Jul 2019 13:28:36 +0000 Date: Thu, 11 Jul 2019 06:28:36 -0700 From: Matthew Wilcox To: Jan Kara Cc: Dan Williams , linux-fsdevel , Boaz Harrosh , stable , Robert Barror , Seema Pandit , linux-nvdimm , Linux Kernel Mailing List Subject: Re: [PATCH] dax: Fix missed PMD wakeups Message-ID: <20190711132836.GR32320@bombadil.infradead.org> References: <20190704032728.GK1729@bombadil.infradead.org> <20190704165450.GH31037@quack2.suse.cz> <20190704191407.GM1729@bombadil.infradead.org> <20190705191004.GC32320@bombadil.infradead.org> <20190710190204.GB14701@quack2.suse.cz> <20190711030855.GO32320@bombadil.infradead.org> <20190711074859.GA8727@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190711074859.GA8727@quack2.suse.cz> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 11, 2019 at 09:48:59AM +0200, Jan Kara wrote: > On Wed 10-07-19 20:08:55, Matthew Wilcox wrote: > > On Wed, Jul 10, 2019 at 09:02:04PM +0200, Jan Kara wrote: > > > @@ -848,7 +853,7 @@ static int dax_writeback_one(struct xa_state *xas, struct dax_device *dax_dev, > > > if (unlikely(dax_is_locked(entry))) { > > > void *old_entry = entry; > > > > > > - entry = get_unlocked_entry(xas); > > > + entry = get_unlocked_entry(xas, 0); > > > > > > /* Entry got punched out / reallocated? */ > > > if (!entry || WARN_ON_ONCE(!xa_is_value(entry))) > > > > I'm not sure about this one. Are we sure there will never be a dirty > > PMD entry? Even if we can't create one today, it feels like a bit of > > a landmine to leave for someone who creates one in the future. > > I was thinking about this but dax_writeback_one() doesn't really care what > entry it gets. Yes, in theory it could get a PMD when previously there was > PTE or vice-versa but we check that PFN's match and if they really do > match, there's no harm in doing the flushing whatever entry we got back... > And the checks are simpler this way. That's fair. I'll revert this part to the way you had it. I actually want to get rid of the PFN match check too; it doesn't really buy us much. We already check whether the TOWRITE bit is set, and that should accomplish the same thing.