From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4633DC4321A for ; Tue, 11 Jun 2019 10:39:29 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7A092080A for ; Tue, 11 Jun 2019 10:39:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7A092080A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45NRML5Bf3zDqcJ for ; Tue, 11 Jun 2019 20:39:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=suse.cz (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=jack@suse.cz; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45NRKC0Cl2zDqZL for ; Tue, 11 Jun 2019 20:37:33 +1000 (AEST) 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 BB1C8AD12; Tue, 11 Jun 2019 10:37:29 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1C7AE1E3E26; Tue, 11 Jun 2019 12:37:29 +0200 (CEST) Date: Tue, 11 Jun 2019 12:37:29 +0200 From: Jan Kara To: "Aneesh Kumar K.V" Subject: Re: [PATCH v3 3/6] mm/nvdimm: Add page size and struct page size to pfn superblock Message-ID: <20190611103729.GA27635@quack2.suse.cz> References: <20190604091357.32213-1-aneesh.kumar@linux.ibm.com> <20190604091357.32213-3-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190604091357.32213-3-aneesh.kumar@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mm@kvack.org, dan.j.williams@intel.com, linuxppc-dev@lists.ozlabs.org, linux-nvdimm@lists.01.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue 04-06-19 14:43:54, Aneesh Kumar K.V wrote: > This is needed so that we don't wrongly initialize a namespace > which doesn't have enough space reserved for holding struct pages > with the current kernel. > > We also increment PFN_MIN_VERSION to make sure that older kernel > won't initialize namespace created with newer kernel. > > Signed-off-by: Aneesh Kumar K.V ... > diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c > index 00c57805cad3..e01eee9efafe 100644 > --- a/drivers/nvdimm/pfn_devs.c > +++ b/drivers/nvdimm/pfn_devs.c > @@ -467,6 +467,15 @@ int nd_pfn_validate(struct nd_pfn *nd_pfn, const char *sig) > if (__le16_to_cpu(pfn_sb->version_minor) < 2) > pfn_sb->align = 0; > > + if (__le16_to_cpu(pfn_sb->version_minor) < 3) { > + /* > + * For a large part we use PAGE_SIZE. But we > + * do have some accounting code using SZ_4K. > + */ > + pfn_sb->page_struct_size = cpu_to_le16(64); > + pfn_sb->page_size = cpu_to_le32(SZ_4K); > + } > + > switch (le32_to_cpu(pfn_sb->mode)) { > case PFN_MODE_RAM: > case PFN_MODE_PMEM: As we discussed with Aneesh privately, this actually means that existing NVDIMM namespaces on PPC64 will stop working due to these defaults for old superblocks. I don't think that's a good thing as upgrading kernels is going to be nightmare due to this on PPC64. So I believe we should make defaults for old superblocks such that working setups keep working without sysadmin having to touch anything. Honza -- Jan Kara SUSE Labs, CR