Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp413203yba; Fri, 12 Apr 2019 06:13:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqykEU0ocglOExJSRmV+mB/VFnGHLU972j9/nNzBpMSiD2Ir9r+tMSsFJQDuF6vc8BsA4Lxj X-Received: by 2002:a62:e80f:: with SMTP id c15mr56500004pfi.93.1555074822626; Fri, 12 Apr 2019 06:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555074822; cv=none; d=google.com; s=arc-20160816; b=mUpvypIh7WfG2/B+GGF+gTGxxMIkIheHnjjB/INfkXrNcOgp3N3kqZG74MYPNpSZWm P/LGZLXca4YiQLn2viVnDZCqPJLq/EyTCRe4I/toL/ntqljH2tH4tWgDKZbp+HTaa5f3 nrhc/6PFfA7tZ9Lkgr4A25BWpUwZ3VwNRaqTrKfg32gF+BMbsQydUQdBR1KntXZwBa8f VioITZcNjixGD+Iv28ANJ20phVf/9GCcI8xu7EXz7zazdYmdodJHxkFxGKcsuGiHZFqg 0E3s0tgW1OlNmoNhcb9TgljtkJVeuLXpVuhwtPxfSGr7+JLSdWHhQA6zmHkpPlqT2ESv 3qRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=oN4H474izC982gzlhiFluEVsoUTcI0SI3GYdllQ4n8Q=; b=Vr+B4gmjR0XH0qYxlcgDMiTN0WqFNm3/hcq9Omt3sUn8+pNrJe08S3sZYkPl7fOlnJ Dcn+M3FVfbviqiybiskveC23/h0HaPYUe5jYpRGj8tWlG+Wdg1HGcb/BSMsfpoPkBq/k oSH651uxensxXA3PFz/f3jcmO2hQNiR5BDS1DSZjLE3U0U0blFMXxyY13POSb41H4WRY 51Q+lzwSSCWj29FUPe5fN8WL9TOBCPHFZYhhtcaVunb+HE02HRScEpp2yV6CR2bGmdUK daByUkL2XNY5kCWTNgpcU3Kfl6zn1neWcHRlguHSUW1Zb+eWGhmtUMAjebgwJbjr+hFr MvYQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si37121897plq.149.2019.04.12.06.13.26; Fri, 12 Apr 2019 06:13:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728413AbfDLNMj (ORCPT + 99 others); Fri, 12 Apr 2019 09:12:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46064 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726714AbfDLNMi (ORCPT ); Fri, 12 Apr 2019 09:12:38 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 83CB5C05681F; Fri, 12 Apr 2019 13:12:26 +0000 (UTC) Received: from segfault.boston.devel.redhat.com (segfault.boston.devel.redhat.com [10.19.60.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 537D519C6F; Fri, 12 Apr 2019 13:12:11 +0000 (UTC) From: Jeff Moyer To: Jan Kara Cc: Dan Williams , 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@oracle.com Subject: Re: [PATCH v5 1/6] libnvdimm: nd_region flush callback support References: <20190410040826.24371-1-pagupta@redhat.com> <20190410040826.24371-2-pagupta@redhat.com> <20190412083230.GA29850@quack2.suse.cz> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Fri, 12 Apr 2019 09:12:10 -0400 In-Reply-To: <20190412083230.GA29850@quack2.suse.cz> (Jan Kara's message of "Fri, 12 Apr 2019 10:32:30 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 12 Apr 2019 13:12:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -Jeff