From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A80AC74A4B for ; Thu, 11 Jul 2019 07:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D757C208E4 for ; Thu, 11 Jul 2019 07:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727974AbfGKH5k (ORCPT ); Thu, 11 Jul 2019 03:57:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:33774 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726088AbfGKH5k (ORCPT ); Thu, 11 Jul 2019 03:57:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 41042AC4C; Thu, 11 Jul 2019 07:57:38 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D9EF31E43B9; Thu, 11 Jul 2019 09:48:59 +0200 (CEST) Date: Thu, 11 Jul 2019 09:48:59 +0200 From: Jan Kara To: Matthew Wilcox Cc: Jan Kara , 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: <20190711074859.GA8727@quack2.suse.cz> References: <20190703195302.GJ1729@bombadil.infradead.org> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190711030855.GO32320@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Honza -- Jan Kara SUSE Labs, CR