Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1230332ybl; Tue, 13 Aug 2019 09:17:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPWUFdR0TS4MiWsIojQ1StJ7ynI4BtffJTDZT+wVdbDFC08IlO56m9gsVRUW02wI+zznpi X-Received: by 2002:a63:2b0c:: with SMTP id r12mr34983896pgr.206.1565713050368; Tue, 13 Aug 2019 09:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565713050; cv=none; d=google.com; s=arc-20160816; b=iZSV/Hi1IX1sbci3hkK6THAat9tDDEhbFZdSMVz4jr/jNbmp0nRneWgUkxw7IsNVQq LKHhDUEcE/PZtHBnc9LJGIcRoilxRNaX1GKh13WPxwR/Z52IFiTt/SkN7hB5BtflPk69 U1Ll5QZjphHH4UCd/nkSdImfj+Aufnn+CxrgKbh7TNzy3pP5D+y9fbebQDv+nIMM4nkT ycYPPrL7whaIko9UkGy1kFUfv2k6ww++860eVrIOxsFPPXApAijtuyjfdW5YRdhAvhVg EJ5nbFmwr99PMG1rZjbJk8dAHTxAmqdWeoRubAA0Wgg+UkbM2f40slbErNKabanebpA+ bPbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=xTAP0SMB0fXPt2iD1kLH6avDVSrCgjJr3jfStv491FI=; b=oIBB0ALp2JHgIvZKksDy7VZbuNuNHrEO1aN0qFQ/81nr5k9U6Npy4CaAEuzGewYeaV MfoNOh3wn8vNkuL7itRomNy4/uWd/YrLD05uwK0CY5JnA0F8uSm8S/2SfyRZbejW0cw0 wKElUlc0BPSR+26dVA+JKRrakUQRnuHXt9+vMzpM3w2KhAiGA9AJyH4aj2EItdCQAeHL 6V55r7UppLAULHmJhKy78iqrF0DtNUWS6iJccerjUXZFhNucekeCoVi5HRQlit/74Exy +16u5NehjBzCK10ilnWVMISiQyT81riUdFovdhADELmdP0qxAAGa9fiBOu36/tgud49D p1Xw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn16si132218plb.97.2019.08.13.09.17.13; Tue, 13 Aug 2019 09:17: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbfHMQPB (ORCPT + 99 others); Tue, 13 Aug 2019 12:15:01 -0400 Received: from ale.deltatee.com ([207.54.116.67]:50680 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbfHMQPB (ORCPT ); Tue, 13 Aug 2019 12:15:01 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1hxZRj-0008W3-Gj; Tue, 13 Aug 2019 10:14:52 -0600 To: Greentime Hu Cc: Rob Herring , Albert Ou , Andrew Waterman , Palmer Dabbelt , Linux Kernel Mailing List , Stephen Bates , paul.walmsley@sifive.com, Olof Johansson , greentime.hu@sifive.com, linux-riscv@lists.infradead.org, Michael Clark , Christoph Hellwig References: <20190109203911.7887-1-logang@deltatee.com> <20190109203911.7887-3-logang@deltatee.com> <0926a261-520e-4c40-f926-ddd40bb8ce44@deltatee.com> <96156909-1453-d487-ff66-a041d67c74d6@deltatee.com> From: Logan Gunthorpe Message-ID: <5506c875-9387-acc9-a7fe-5b7c10036c40@deltatee.com> Date: Tue, 13 Aug 2019 10:14:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: hch@lst.de, michaeljclark@mac.com, linux-riscv@lists.infradead.org, greentime.hu@sifive.com, olof@lixom.net, paul.walmsley@sifive.com, sbates@raithlin.com, linux-kernel@vger.kernel.org, palmer@sifive.com, andrew@sifive.com, aou@eecs.berkeley.edu, robh@kernel.org, green.hu@gmail.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v4 2/2] RISC-V: Implement sparsemem X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-08-13 12:04 a.m., Greentime Hu wrote: > I think flat mem doesn't support memory-with-hole scenario. > In mm/Kconfig, it says > " > For systems that have holes in their physical address > spaces and for features like NUMA and memory hotplug, > choose "Sparse Memory" > " > IMHO, the memory-with-hole scenario should only be tested for sparse > mem but flat mem. Fair enough. > The generic pfn_valid() is just for non-mmu arches. The generic pfn_valid() in asm-generic is only for non-mmu arches. > Every architecture > with mmu defines their own pfn_valid(). Not true. Arm64, for example just uses the generic implementation in mmzone.h. My main question is whether we can just do that. If we can't we should probably structure it like powerpc where they only use the arch-specific helper for CONFIG_FLATMEM instead of when CONFIG_SPARSEMEM isn't set. Logan