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=-5.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 6ABDFC352A2 for ; Fri, 7 Feb 2020 12:14:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2DB1A20838 for ; Fri, 7 Feb 2020 12:14:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EZW0vVT/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DB1A20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B9D8A6B0003; Fri, 7 Feb 2020 07:14:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B501B6B0005; Fri, 7 Feb 2020 07:14:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A40266B0007; Fri, 7 Feb 2020 07:14:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id 880516B0003 for ; Fri, 7 Feb 2020 07:14:56 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 44F91824805A for ; Fri, 7 Feb 2020 12:14:56 +0000 (UTC) X-FDA: 76463224992.27.crow02_653f8852aae1d X-HE-Tag: crow02_653f8852aae1d X-Filterd-Recvd-Size: 5539 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Feb 2020 12:14:55 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id u6so2453928wrt.0 for ; Fri, 07 Feb 2020 04:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=D+DJ3MiV/rAwduMcYLUzMxxDEjOIvkp9prmU1gHjEWI=; b=EZW0vVT/8ToglsskcvB7pO/NK/uGzBxoZFPvWQwkUOpSUBe6+BTaL27aLeRY7TzBOd oDISQbFTS93cmfBmWo8eUwPN3PWSP0kC0GDNvfUaGziNAoN6lc/AELr41KV6HQIHqCBc JIEmXiZIfUDNUx5mPqKZVGTCmXIHbOIanuS+i6QnxSAK+X5Mg830zPZg56BbFDkpYE+k B8wlLl8FdHn1CWZV2hXWLmeiNeBPYOquQ8L0OUKHVIeahpE/aoWCO0sLx6vskGsM99SH Wk5tvPOykdJHURYkNgVIebtbEzeq+N2PNJsF+/fmBTWEvH9NGsJqqH8XSLqpn+vIw4Xx GLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=D+DJ3MiV/rAwduMcYLUzMxxDEjOIvkp9prmU1gHjEWI=; b=oU84UQO3D/j1jTCZ5rq68f36dK4pjSp8y4H8TBnO3FgU76qxrLBJ4RZWdfRdi0GdlS 2ilpIH1ghmDZfNVHxvHjNo9EEuZuIb09O3+gguWGg5eGWjSM2yL8dYCQWH+d0HGuoF3A 1naDVgJBbF4aePcgWWJeAZhHnK0+Idn/DozuoeGbrYyRP6wbUau2YUH6p/8lJTar72Ub SPGmKnsNCVSD7uKVJevJRDzWlfOzt1y4PUZ2ceTLbIiDwx82Grzeu0aVoId1e4Yy8GJw 19f8tVJgieUNwotw7cg+edM5uarOMn8ypVBzuovLLMsYcIAWKBDUQeAJW73alnUngCbe 16eQ== X-Gm-Message-State: APjAAAVUyxJPG0zwPkUZDnXeSxxEB7YuenKOAqA3h8s8CZlo6kYI9xuL uZVlZ/B/9wP9dLjrOnknCPw= X-Google-Smtp-Source: APXvYqyf7afUCNAQVdJ5niEs/j9rjlttWxI0pheKOqKFQUqprZM6nczwXNDpeTOK5useb0g24hJVdw== X-Received: by 2002:adf:c54e:: with SMTP id s14mr4271269wrf.385.1581077694469; Fri, 07 Feb 2020 04:14:54 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id y12sm3175421wmj.6.2020.02.07.04.14.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Feb 2020 04:14:53 -0800 (PST) Date: Fri, 7 Feb 2020 12:14:53 +0000 From: Wei Yang To: Dan Williams Cc: Baoquan He , Wei Yang , Andrew Morton , Oscar Salvador , Linux MM , Linux Kernel Mailing List , David Hildenbrand Subject: Re: [PATCH 2/3] mm/sparsemem: get physical address to page struct instead of virtual address to pfn Message-ID: <20200207121453.pgi4axyvx6peqgeo@master> Reply-To: Wei Yang References: <20200206231629.14151-1-richardw.yang@linux.intel.com> <20200206231629.14151-3-richardw.yang@linux.intel.com> <20200207031011.GR8965@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 06, 2020 at 07:21:49PM -0800, Dan Williams wrote: >On Thu, Feb 6, 2020 at 7:10 PM Baoquan He wrote: >> >> Hi Dan, >> >> On 02/06/20 at 06:19pm, Dan Williams wrote: >> > On Thu, Feb 6, 2020 at 3:17 PM Wei Yang wrote: >> > > diff --git a/mm/sparse.c b/mm/sparse.c >> > > index b5da121bdd6e..56816f653588 100644 >> > > --- a/mm/sparse.c >> > > +++ b/mm/sparse.c >> > > @@ -888,7 +888,7 @@ int __meminit sparse_add_section(int nid, unsigned long start_pfn, >> > > /* Align memmap to section boundary in the subsection case */ >> > > if (IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP) && >> > > section_nr_to_pfn(section_nr) != start_pfn) >> > > - memmap = pfn_to_kaddr(section_nr_to_pfn(section_nr)); >> > > + memmap = pfn_to_page(section_nr_to_pfn(section_nr)); >> > >> > Yes, this looks obviously correct. This might be tripping up >> > makedumpfile. Do you see any practical effects of this bug? The kernel >> > mostly avoids ->section_mem_map in the vmemmap case and in the >> > !vmemmap case section_nr_to_pfn(section_nr) should always equal >> > start_pfn. >> >> The practical effects is that the memmap for the first unaligned section will be lost >> when destroy namespace to hot remove it. Because we encode the ->section_mem_map >> into mem_section, and get memmap from the related mem_section to free it in >> section_deactivate(). In fact in vmemmap, we don't need to encode the ->section_mem_map >> with memmap. > >Right, but can you actually trigger that in the SPARSEMEM_VMEMMAP=n case? > >> By the way, sub-section support is only valid in vmemmap case, right? > >Yes. Just one question from curiosity. Why we don't want sub-section for !vmemmap case? Because it will wast memory for memmap? > >> Seems yes from code, but I don't find any document to prove it. > >check_pfn_span() enforces this requirement. -- Wei Yang Help you, Help me