Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2690098ybi; Thu, 4 Jul 2019 17:13:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqbESsVwvfVenyI9Emg2XIrc0/v42wQ6izDhmXYFtPel7HzqGgGIdMgUxL5NpYikyZg/5S X-Received: by 2002:a17:902:403:: with SMTP id 3mr967855ple.66.1562285620914; Thu, 04 Jul 2019 17:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562285620; cv=none; d=google.com; s=arc-20160816; b=ODiwbHJULb9Pj+FMsLXPIHbioHzx0fT6ByGdLNTR6lDMWV0E4jKCcyGZfBE0qjueoh hRpN/ttw3Sh2hvSIh4n479+EcUv8dnGVK9P93TRJif57vbgMPCZLrA9m/e8BVAzpW6/1 xTq/bbkOHbXSQq+7quz3rX3/KRv7km3sULtvHWZvOmkG0zuXogAj3o94v21nfToMj0+B LU0/fEYIdNKIGLpoWl1NbqEImA651ZfBcMI7bKs+vl+4o8AaevvgQTz90sxcDGJseCFN GuG0azz9yTbQ6fcmKwFxi6N3gXfOxrS33qk9PAshuoNJFzu6r6HAoxidLXSdYlxS68YF PrYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=29vsGpTjh39zWXsI6Ik43Nv+EdiuWAOV6vxVTajp20k=; b=yxg9m8Hz+UTDkA4N0V8e1tIoUChIjn/YErNe6SjgItMCJBkGt4zr9KloiEiF6zH+nh XBErlq+d6aaBOVCYJpeACORUrKEwWmaVLcVFqthEsaXFy0ntbhjs/TvWo48zdQ39VNH2 hsBYoFFV1zzH0vrjbZNJVydqRRimALAZYiMxy/WYtVFpugZ8TSRPuIO7XxCmCIP5/tDW Gif69uncZxyVA0K2J6ux6HDqxQNkiSWoF19kyvOP1mFlCbMfNcZfIzzJyMHzk5BZCbBY n6d2B8Vmpq6xiFTK2IaWndDqEWhfpTVzVsQE/MU6+BO5haIX892ICdQ0wJ1zfl6K838o 05Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=xPh6pbcm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si6580317plp.31.2019.07.04.17.13.25; Thu, 04 Jul 2019 17:13:40 -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=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=xPh6pbcm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727410AbfGDX10 (ORCPT + 99 others); Thu, 4 Jul 2019 19:27:26 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:40987 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726024AbfGDX10 (ORCPT ); Thu, 4 Jul 2019 19:27:26 -0400 Received: by mail-ot1-f65.google.com with SMTP id o101so7310095ota.8 for ; Thu, 04 Jul 2019 16:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=29vsGpTjh39zWXsI6Ik43Nv+EdiuWAOV6vxVTajp20k=; b=xPh6pbcmI7ZR83uwzt44/h5WZ1jKG98r+LQaDHsemaTjfAFmLK4NHwQNObxnmJM5M8 kiKlk4co3uBSxHYbFY+WMMvf50uquNZyF0w7RVkb+wN9QHaDcveJWANUrWindaZdPjYX fRPefhjZL+h/GTwMBlPyo/7+/fOiU2/TzGWz4bA8jxIM0dAKYaLHEKDaVOkAQSEXS/JJ HntfFU+nDsisSL67tqCRY1E2FW29XVGHkHGY+9yi5XPwwkF8dUbKQwZFovjFinBx4P3H +CX76/THYqM9Ar2u/pO3kfTI759leI2eRYxgBjawd3DUVZuTF7q3s4H/zjBzZl96hbN0 jkcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=29vsGpTjh39zWXsI6Ik43Nv+EdiuWAOV6vxVTajp20k=; b=C6OhenMo8FFwhNguBcDerqh6IPADMBxVEf4eMT/3GhzKO3uhODrThfDXd+LzyJSJXG XIIZk//gWc9gYNL06Yo1Lo9MNgw4CkiWvNSp/Z+RxS+jGFU2YOC+gBYdxdeNo1WZsE8Y RNviQiiAiU3QCRkFvN7Ebimva3y/MOdxSWofYrjxcc/37/ESS2FpygB1I127pts15TCU czaaVBBtE6WxR7mHW4j2Ygq/lHRtEM0wqG9QvBEcOeYaJgBKvNv52RfpHS5t8nppmHOw Ss110NCU4aWBet8uUc/y90XXjeM/YBDjYjTakD3e5gX9eR26e3c5SifqFpGZ3nzHQ6Di KLkw== X-Gm-Message-State: APjAAAXF2Jo5o1WUxyIDYU4Mx1G4MInxH+TqB+Zbmd3f48QGvZQZ5Xzm adeOJiPU4xYk5SgXhTI0FAbQY9ftGSQuwZSL70RHKw== X-Received: by 2002:a9d:7a9a:: with SMTP id l26mr386103otn.71.1562282845133; Thu, 04 Jul 2019 16:27:25 -0700 (PDT) MIME-Version: 1.0 References: <156213869409.3910140.7715747316991468148.stgit@dwillia2-desk3.amr.corp.intel.com> <20190703121743.GH1729@bombadil.infradead.org> <20190703195302.GJ1729@bombadil.infradead.org> <20190704032728.GK1729@bombadil.infradead.org> <20190704165450.GH31037@quack2.suse.cz> <20190704191407.GM1729@bombadil.infradead.org> In-Reply-To: <20190704191407.GM1729@bombadil.infradead.org> From: Dan Williams Date: Thu, 4 Jul 2019 16:27:14 -0700 Message-ID: Subject: Re: [PATCH] dax: Fix missed PMD wakeups To: Matthew Wilcox Cc: Jan Kara , linux-fsdevel , Boaz Harrosh , stable , Robert Barror , Seema Pandit , linux-nvdimm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 4, 2019 at 12:14 PM Matthew Wilcox wrote: > > On Thu, Jul 04, 2019 at 06:54:50PM +0200, Jan Kara wrote: > > On Wed 03-07-19 20:27:28, Matthew Wilcox wrote: > > > So I think we're good for all current users. > > > > Agreed but it is an ugly trap. As I already said, I'd rather pay the > > unnecessary cost of waiting for pte entry and have an easy to understand > > interface. If we ever have a real world use case that would care for this > > optimization, we will need to refactor functions to make this possible and > > still keep the interfaces sane. For example get_unlocked_entry() could > > return special "error code" indicating that there's no entry with matching > > order in xarray but there's a conflict with it. That would be much less > > error-prone interface. > > This is an internal interface. I think it's already a pretty gnarly > interface to use by definition -- it's going to sleep and might return > almost anything. There's not much scope for returning an error indicator > either; value entries occupy half of the range (all odd numbers between 1 > and ULONG_MAX inclusive), plus NULL. We could use an internal entry, but > I don't think that makes the interface any easier to use than returning > a locked entry. > > I think this iteration of the patch makes it a little clearer. What do you > think? > Not much clearer to me. get_unlocked_entry() is now misnamed and this arrangement allows for mismatches of @order argument vs @xas configuration. Can you describe, or even better demonstrate with numbers, why it's better to carry this complication than just converging the waitqueues between the types?