Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10214755ybi; Thu, 11 Jul 2019 01:36:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1iTLmbF9kDRq4h/49vCHjQlahdt0dFXR48dFBzHReQiPuK/g8M8hMbFU0cn0yhRdwH+fa X-Received: by 2002:a63:2148:: with SMTP id s8mr3063410pgm.336.1562834166118; Thu, 11 Jul 2019 01:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562834166; cv=none; d=google.com; s=arc-20160816; b=p0PnUuKrF1InDz8qPQX/VmmEmUnYa0ef5CFIufFaOcNCQ6H5CAEKRUVVh0mnB0YsDU P7vOS9r88d9IjZCafNitTxHGVfQlhZy6DigfAcAA2XvzBfheQkjYuqKe5BszE/Y/O2XW ndkSD3zUI1G8Qq73BMhwIVOJl8vk4wCdWXel1UXGlgW/ibA0IIvMoP2Xf4K4fWwCJyXD Kk1g1bRmYyhOBpfORT0tx/kgMtqMpX9ow65sT8ShfAOErlc32dg7ZTWp9yqcmI0I2/eg rSVxNIXD78Vq/WveOMBAvn2vpbikILuY8c1QbyBjjnKgzbRqrqB0zfX+PV4PNCXiLgOT 0Jbw== 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; bh=X6PyudKnoM2gPMYGjlqSbD12naeR3hB0bhK4srfdo7A=; b=Hj/Foo8RLWCPrbJNZmsk80BSEPC4/Gg47fTP7+VqJkUeWmZ9S3r00umeyIf13re09x EygaQR9rX6gcE/OsSfQ3oGxHyvoWdRfLXrjj3FygrlhNy3n3fCvgyGObudgHJruEL4K4 GVECrMwAP0YEDzYIivdUSD/rnz/pRn6lP1X4Pvnd2VWPlXcZZqZuFKiCCNoh4ljRy8CI Y+/q8CpgcITaFg4rl3XnMOwhfTyizIfW+mVRgvHOIU/xJT+xiPVeNV3DqPPSxSxAawoJ L/4Ewq7UwMKhVELKd2PzMv6qz7z2UrIAIuqpbjaFosRhVGgW/gLKUUWURdzxGiXTECfq B1NA== 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 t18si4649367pfh.29.2019.07.11.01.35.50; Thu, 11 Jul 2019 01:36:06 -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; 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 S1727959AbfGKH5k (ORCPT + 99 others); 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