Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2144779ybv; Fri, 14 Feb 2020 12:20:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwGOpbJv+TrTSlzKtUzls14PgBHfpXxkHolDvofx/cmJw310T5xzMlksj/EYoArFaiETkwL X-Received: by 2002:a05:6808:b23:: with SMTP id t3mr3144848oij.88.1581711621042; Fri, 14 Feb 2020 12:20:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581711621; cv=none; d=google.com; s=arc-20160816; b=0FgBWuhdU3wrrzyvRs+5ijMrNFL8Wr8xlMKVkyLQrIzrzVPaDPEo664Nmqb30WR+Bm rdKhDYbo8nKgfvf1oL1Sj5GGASbkRwopeJVXy5vA+N4X/oibFKjBg/7vM35PIxThxlOY IztygwzVCzBbOKf2vQW4E+9MsSzAqZKwhhfy8gsteOXxX0jOQkkBbkJF1HjIbbYpv5NT wKKhcfQEiQ/DL3ojyeZx+LStDGMNZjuAAGMEdHLifV9ZkAPgrDSen90eh9Uvy0AjniwF LFCUjojdX+wqnhVDMUDRZir2ayabNYK0ik43hZtzaDIpl5WTtmohAG93kyV8tj29aykg scrw== 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:dkim-signature; bh=zUUGrdP4j1cXvm1eFGmQNpbG1sQHN9lpbJso5oFN/oI=; b=RmKGa5cZzKNmvOMRobzQ9tiKvvayoSwWlYand7Gq4UBOHoJ8tvDpLQT4BzPtYvVx9d aI7HU8J2NUtUy2pMNxzSXtlmDUQHlKFOhhBvhwA0/7xjtkUJt59BA/FSRIVBwUBT6sTT +AhBmLxriUnO9y3naOm4Wcgf9ifGedDu52cwM19FXRnTlqfYETT1ksirUrtadKtNRaej T0cwBD+kqmaYA6QotBGB/p7DeAH7IvNZcKIKYhstuON7UtR4sQ2LG22sst4W0iz86Gto pQheFkLQjw9gtl+Hrzlt92Ws5bPVphNKaWIhgW9imt9CDi4fuj4Cz04hN7FLr/kPh171 DU9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DmxcQ55O; 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=pass (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 m4si3471145otn.281.2020.02.14.12.20.08; Fri, 14 Feb 2020 12:20:21 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=DmxcQ55O; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729954AbgBNUTU (ORCPT + 99 others); Fri, 14 Feb 2020 15:19:20 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:24432 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729633AbgBNUTU (ORCPT ); Fri, 14 Feb 2020 15:19:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581711558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zUUGrdP4j1cXvm1eFGmQNpbG1sQHN9lpbJso5oFN/oI=; b=DmxcQ55OmQP2HCjIZhCBScsv8nSesXpllsPfdxNYOG33tZsBl5OpS6xS9km+maWttzDFE8 DyNLT/MvBRgkOLOV6oxYY1Kha9GdhGi0y/cB0dbiq5ekrGQohnwCOmVlZAf42cjWdmsQkP LPyfI8oI5bzDZUi9v4oQrf+XNanEK5E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-153-BGeSogtHN2ixrrdRK5EOyg-1; Fri, 14 Feb 2020 15:19:10 -0500 X-MC-Unique: BGeSogtHN2ixrrdRK5EOyg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28490108592A; Fri, 14 Feb 2020 20:19:09 +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 687605C1D8; Fri, 14 Feb 2020 20:19:08 +0000 (UTC) From: Jeff Moyer To: Dan Williams Cc: linux-nvdimm@lists.01.org, "Aneesh Kumar K.V" , vishal.l.verma@intel.com, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 4/4] libnvdimm/region: Introduce an 'align' attribute References: <158155489850.3343782.2687127373754434980.stgit@dwillia2-desk3.amr.corp.intel.com> <158155491952.3343782.4541070487858304628.stgit@dwillia2-desk3.amr.corp.intel.com> X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 Date: Fri, 14 Feb 2020 15:19:07 -0500 In-Reply-To: <158155491952.3343782.4541070487858304628.stgit@dwillia2-desk3.amr.corp.intel.com> (Dan Williams's message of "Wed, 12 Feb 2020 16:48:39 -0800") 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.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dan Williams writes: > The align attribute applies an alignment constraint for namespace > creation in a region. Whereas the 'align' attribute of a namespace > applied alignment padding via an info block, the 'align' attribute > applies alignment constraints to the free space allocation. > > The default for 'align' is the maximum known memremap_compat_align() > across all archs (16MiB from PowerPC at time of writing) multiplied by > the number of interleave ways if there is blk-aliasing. The minimum is > PAGE_SIZE and allows for the creation of cross-arch incompatible > namespaces, just as previous kernels allowed, but the expectation is > cross-arch and mode-independent compatibility by default. > > The regression risk with this change is limited to cases that were > dependent on the ability to create unaligned namespaces, *and* for some > reason are unable to opt-out of aligned namespaces by writing to > 'regionX/align'. If such a scenario arises the default can be flipped > from opt-out to opt-in of compat-aligned namespace creation, but that is > a last resort. The kernel will otherwise continue to support existing > defined misaligned namespaces. > > Unfortunately this change needs to touch several parts of the > implementation at once: > > - region/available_size: expand busy extents to current align > - region/max_available_extent: expand busy extents to current align > - namespace/size: trim free space to current align > > ...to keep the free space accounting conforming to the dynamic align > setting. > > Reported-by: Aneesh Kumar K.V > Reported-by: Jeff Moyer > Signed-off-by: Dan Williams > Reviewed-by: Aneesh Kumar K.V > Link: https://lore.kernel.org/r/158041478371.3889308.14542630147672668068.stgit@dwillia2-desk3.amr.corp.intel.com > Signed-off-by: Dan Williams This looks good to me. Reviewed-by: Jeff Moyer