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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=no 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 9D260C433E0 for ; Mon, 29 Jun 2020 22:58:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6ACE7206E9 for ; Mon, 29 Jun 2020 22:58:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6ACE7206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EE3E78D0015; Mon, 29 Jun 2020 18:58:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E946E8D000F; Mon, 29 Jun 2020 18:58:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAAEE8D0015; Mon, 29 Jun 2020 18:58:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0248.hostedemail.com [216.40.44.248]) by kanga.kvack.org (Postfix) with ESMTP id C42E48D000F for ; Mon, 29 Jun 2020 18:58:57 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6AB13180AD83A for ; Mon, 29 Jun 2020 22:58:57 +0000 (UTC) X-FDA: 76983766314.19.cord98_2f112f626e73 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 2241B1ACC32 for ; Mon, 29 Jun 2020 22:58:57 +0000 (UTC) X-HE-Tag: cord98_2f112f626e73 X-Filterd-Recvd-Size: 4565 Received: from out4436.biz.mail.alibaba.com (out4436.biz.mail.alibaba.com [47.88.44.36]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Mon, 29 Jun 2020 22:58:56 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04407;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0U16XY0q_1593471523; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U16XY0q_1593471523) by smtp.aliyun-inc.com(127.0.0.1); Tue, 30 Jun 2020 06:58:43 +0800 Date: Tue, 30 Jun 2020 06:58:42 +0800 From: Wei Yang To: Dan Williams Cc: Wei Yang , David Hildenbrand , Michal Hocko , Andrew Morton , Oscar Salvador , Linux MM , Baoquan He , Linux Kernel Mailing List Subject: Re: [PATCH] mm/spase: never partially remove memmap for early section Message-ID: <20200629225842.GA38617@L-31X9LVDL-1304.local> Reply-To: Wei Yang References: <4D73CD59-BFD5-401A-A001-41F7BF5641BA@redhat.com> <20200629083411.GA38188@L-31X9LVDL-1304.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 2241B1ACC32 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 Content-Transfer-Encoding: quoted-printable 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 Mon, Jun 29, 2020 at 03:13:25PM -0700, Dan Williams wrote: >On Mon, Jun 29, 2020 at 1:34 AM Wei Yang > wrote: >> >> On Thu, Jun 25, 2020 at 12:46:43PM -0700, Dan Williams wrote: >> >On Wed, Jun 24, 2020 at 10:53 PM David Hildenbrand = wrote: >> >> >> >> >> >> >> >> > Am 25.06.2020 um 01:47 schrieb Dan Williams : >> >> > >> >> > =EF=BB=BFOn Wed, Jun 24, 2020 at 3:44 PM Wei Yang >> >> > wrote: >> >> > [..] >> >> >>> So, you are right that there is a mismatch here, but I think th= e >> >> >>> comprehensive fix is to allow early sections to be partially >> >> >>> depopulated/repopulated rather than have section_activate() and >> >> >>> section_deacticate() special case early sections. The special c= asing >> >> >>> is problematic in retrospect as section_deactivate() can't be >> >> >>> maintained without understand special rules in section_activate= (). >> >> >> >> >> >> Hmm... This means we need to adjust pfn_valid() too, which alway= s return true >> >> >> for early sections. >> >> > >> >> > Right, rather than carry workarounds in 3 locations, and the bug = that >> >> > has resulted from then getting out of sync, just teach early sect= ion >> >> > mapping to allow for the subsection populate/depopulate. >> >> > >> >> >> >> I prefer the easy fix first - IOW what we Here here. Especially, pf= n_to_online_page() will need changes as well. >> > >> >Agree, yes, let's do the simple fix first for 5.8 and the special-cas= e >> >elimination work later. >> >> Dan, >> >> A quick test shows this is not a simple task. > >Thanks for taking a look... > >> First, early sections don't set subsection bitmap, which is necessary = for the >> hot-add/remove. >> >> To properly set subsection bitmap, we need to know how many subsection= s in >> early section. While current code doesn't has a alignment requirement = for >> last early section. We mark the whole last early section as present. > >I was thinking that the subsection map does not need to be accurate on >initial setup, it only needs to be accurate after the first removal. >However, that would result in new special casing that somewhat defeats >the purpose. The hardest part is potentially breaking up a PMD mapping >of the page array into a series of PTE mappings without disturbing >in-flight pfn_to_page() users. > >> I don't find a way to enable this. > >While I don't like that this bug crept into the mismatched special >casing of early sections, I'm now coming around to the same opinion. >I.e. that making the memmap for early sections permanent is a simpler >mechanism to maintain. I think so ... --=20 Wei Yang Help you, Help me