Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp760112yba; Thu, 18 Apr 2019 09:06:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzz3v+anuyoRagvJ4ZdxVkuMCSJq44NAPHdkPqkuLtS3mxPdvneFjLZvhEc977y7Lwh7gvG X-Received: by 2002:a17:902:2:: with SMTP id 2mr96982817pla.61.1555603591003; Thu, 18 Apr 2019 09:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555603590; cv=none; d=google.com; s=arc-20160816; b=VxaX6JsmY4DGVdDhkBQYfV2O3BrQG57eASXtWspG0edi4uSIO95EZBSKwaJ1i5VrRt Lu4RRjOW2mv0NlqYQz8NhmNotYJogq3H7LgmK7u2Zc3Sxa9v6p4UL3Swp7HpvZf/+x25 dTteduGijNN4Elwe8r3yzRG/FQTly9a2H0vWx9cnk4iXEdXXeA92OagFL9dPoppJ5jrq tnud6eNvmJRtNdPjwpFOUnwsIYsF7mrOclVojwlI4YiKSBkX6S+oeyE+A/PGLcLOsjRV TBKRCWAm6kcMlAZJ8laeIpOcFFrKk1VvKVp5FQ9kgwWc1XZ0oAmAjxjN8QFoQcFqDW2M 2t0Q== 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=9656FNKKp4cUVga3XUcreKMqWUBjOMnkCExkfsBvcE0=; b=JMKNkYcKXGmEtYJPKwzQ1N8CpPEn4+AGFJf5xP3PrkaDOu+B7lWmoH4GsDat6yieSj pX2cGzQ5flqvnaj+948dwdClPjxJmtxxD3EfamY6ZJfgu2Fvb6apOsYqoksJUSXgajRQ 2oylnOk/zdsND1oP1+HN0L1DhW0BWhBKHUN7aenhdZ0gX6/0m+N8XGahIKJaNV/61sRD sgu5LyVv090sLjHtcMkiRPgQ2IZsA75R9eDcwZ7x9kwJwYyZm0vzp0VlHLaeWDB9N2ut yPnP5SIqNNQzcYH+CEpNFwtoYGTQkShi5whE4ufJwzlFHPaX3PargDcxgnBWMV1Ejsoa b8MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ATWDxkO+; 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 j184si2945765pfb.106.2019.04.18.09.06.15; Thu, 18 Apr 2019 09:06:30 -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=ATWDxkO+; 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 S2389594AbfDRQFT (ORCPT + 99 others); Thu, 18 Apr 2019 12:05:19 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:43175 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388401AbfDRQFS (ORCPT ); Thu, 18 Apr 2019 12:05:18 -0400 Received: by mail-oi1-f194.google.com with SMTP id t81so1997695oig.10 for ; Thu, 18 Apr 2019 09:05:17 -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=9656FNKKp4cUVga3XUcreKMqWUBjOMnkCExkfsBvcE0=; b=ATWDxkO+EzohN5YWedA5OnfOl7z0C5wosAmTrDF5hxxtYtjNdCK/9PHgnZhYETJJ8t vacr+rHkJxxNGOmeI1vTif1Vl4SIwdCSz21szdtTalMtQ8a/1Obxe+VdKwZnY8xrFtd+ ciBIJxCm9FZlAQVPiOTKZr8Xdghbnp/hQTXS/ucudKTmB79U11kjETh4fqNlfW3T1gK0 Zu87he2RHQTC+AM19urSAzmn3PITVUqT2oXHTybHWlpO7u1bFfMxyXZLHVTzCvZ6mXjc bD19cp4gsnL0R2s/7Y3bFqcAI2a5/xvDNGJEJYE3ed3iSmhC+ui2TozfrYHnQqDdah3m ZD3A== 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=9656FNKKp4cUVga3XUcreKMqWUBjOMnkCExkfsBvcE0=; b=LHB2KID4fap4CzArrZAg4iRsHW62QSKKO2vaVSeHiOi3lNvD2cRvT1hK3ckzW6Wn2F 2WbOMnpkzggB1Y4SV3HwqJ31D1+J+q0HSjVROxjkq6SsyhZpjxPDNhoeEAFjamV4EWaB UpAWnKgJc6le0H//S+hMaWEFNuVM+g7Scc1xmaNqtLimluyONLmqR7sFlE8dylkjKwGo m+JBcVnIOMELsxA8ISnbt3dcsDood5ALjFcqtEe/y097GQ2H1YdHOrvROhYjXj6XTpBw OVXX4U/PzwLf8ck4B+Kgq5HGatLHo/ngq5hb02BhIP6TONJ+hJVchUA5/ipYrWKXRAr5 vjrw== X-Gm-Message-State: APjAAAV0gbEOUCGeN5mJH0/iA/0BaxWcTzMeXgwgdaB8cKWpRJEx+xtH I08ytagJ9ap+Q/vkwmF3vN+syiOqyFxikKeJFfsZiw== X-Received: by 2002:aca:ed88:: with SMTP id l130mr2422676oih.70.1555603517276; Thu, 18 Apr 2019 09:05:17 -0700 (PDT) MIME-Version: 1.0 References: <20190410040826.24371-1-pagupta@redhat.com> <20190410040826.24371-2-pagupta@redhat.com> <20190412083230.GA29850@quack2.suse.cz> In-Reply-To: From: Dan Williams Date: Thu, 18 Apr 2019 09:05:05 -0700 Message-ID: Subject: Re: [PATCH v5 1/6] libnvdimm: nd_region flush callback support To: Jeff Moyer Cc: Jan Kara , Pankaj Gupta , linux-nvdimm , Linux Kernel Mailing List , virtualization@lists.linux-foundation.org, KVM list , linux-fsdevel , Linux ACPI , Qemu Developers , linux-ext4 , linux-xfs , Ross Zwisler , Vishal L Verma , Dave Jiang , "Michael S. Tsirkin" , Jason Wang , Matthew Wilcox , "Rafael J. Wysocki" , Christoph Hellwig , Len Brown , "Theodore Ts'o" , Andreas Dilger , "Darrick J. Wong" , lcapitulino@redhat.com, Kevin Wolf , Igor Mammedov , Nitesh Narayan Lal , Rik van Riel , Stefan Hajnoczi , Andrea Arcangeli , David Hildenbrand , david , cohuck@redhat.com, Xiao Guangrong , Paolo Bonzini , kilobyte@angband.pl, yuval shaia 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 Fri, Apr 12, 2019 at 6:12 AM Jeff Moyer wrote: > > Jan Kara writes: > > > On Thu 11-04-19 07:51:48, Dan Williams wrote: > >> On Tue, Apr 9, 2019 at 9:09 PM Pankaj Gupta wrote: > >> > + } else { > >> > + if (nd_region->flush(nd_region)) > >> > + rc = -EIO; > >> > >> Given the common case wants to be fast and synchronous I think we > >> should try to avoid retpoline overhead by default. So something like > >> this: > >> > >> if (nd_region->flush == generic_nvdimm_flush) > >> rc = generic_nvdimm_flush(...); > > > > I'd either add a comment about avoiding retpoline overhead here or just > > make ->flush == NULL mean generic_nvdimm_flush(). Just so that people don't > > get confused by the code. > > Isn't this premature optimization? I really don't like adding things > like this without some numbers to show it's worth it. I don't think it's premature given this optimization technique is already being deployed elsewhere, see: https://lwn.net/Articles/774347/