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=-0.7 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 4E0ABC433E1 for ; Fri, 10 Jul 2020 01:14:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E900220708 for ; Fri, 10 Jul 2020 01:14:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E900220708 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 5D07D6B0002; Thu, 9 Jul 2020 21:14:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 57F8E6B0005; Thu, 9 Jul 2020 21:14:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 496AE6B0006; Thu, 9 Jul 2020 21:14:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0187.hostedemail.com [216.40.44.187]) by kanga.kvack.org (Postfix) with ESMTP id 34AF36B0002 for ; Thu, 9 Jul 2020 21:14:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9C2CD82499A8 for ; Fri, 10 Jul 2020 01:14:16 +0000 (UTC) X-FDA: 77020395312.25.sail71_61065de26eca Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id 5EACE1804E3A1 for ; Fri, 10 Jul 2020 01:14:16 +0000 (UTC) X-HE-Tag: sail71_61065de26eca X-Filterd-Recvd-Size: 3549 Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 01:14:14 +0000 (UTC) X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01419;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---0U2F61Zf_1594343650; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U2F61Zf_1594343650) by smtp.aliyun-inc.com(127.0.0.1); Fri, 10 Jul 2020 09:14:10 +0800 Date: Fri, 10 Jul 2020 09:14:10 +0800 From: Wei Yang To: Dmitry Osipenko Cc: Wei Yang , akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, vbabka@suse.cz, yang.shi@linux.alibaba.com, thomas_os@shipmail.org, anshuman.khandual@arm.com, sean.j.christopherson@intel.com, peterx@redhat.com, aneesh.kumar@linux.ibm.com, willy@infradead.org, thellstrom@vmware.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, "linux-arm-kernel@lists.infradead.org" Subject: Re: [Patch v4 0/4] mm/mremap: cleanup move_page_tables() a little Message-ID: <20200710011410.GC51939@L-31X9LVDL-1304.local> Reply-To: Wei Yang References: <20200708095028.41706-1-richard.weiyang@linux.alibaba.com> <3cab86b0-586e-781b-1620-f28b00c57d44@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3cab86b0-586e-781b-1620-f28b00c57d44@gmail.com> X-Rspamd-Queue-Id: 5EACE1804E3A1 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 Thu, Jul 09, 2020 at 10:38:58PM +0300, Dmitry Osipenko wrote: >08.07.2020 12:50, Wei Yang =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> move_page_tables() tries to move page table by PMD or PTE. >>=20 >> The root reason is if it tries to move PMD, both old and new range sho= uld be >> PMD aligned. But current code calculate old range and new range separa= tely. >> This leads to some redundant check and calculation. >>=20 >> This cleanup tries to consolidate the range check in one place to redu= ce some >> extra range handling. >>=20 >> v4: >> * remove a redundant parentheses pointed by Kirill >>=20 >> v3: >> * merge patch 1 with 2 as suggested by Kirill > >> * add patch 4 to simplify the logic to calculate next and extent > >Hello, Wei! > >Unfortunately you re-introduced the offending change that was fixed in >v2 and today's next-20200709 on ARM32 is broken once again: > >BUG: Bad rss-counter state mm:db85ec46 type:MM_ANONPAGES val:190 > Ah, my bad, I forget the error we met last time. It is the different form= at of pmd_addr_end. Sorry for that. @ Kirill If you agree, I would leave the extent/next calculation as it is in patch= 3. >Please don't do it ;) > >> v2: >> * remove 3rd patch which doesn't work on ARM platform. Thanks report= and >> test from Dmitry Osipenko >>=20 >> Wei Yang (4): >> mm/mremap: it is sure to have enough space when extent meets >> requirement >> mm/mremap: calculate extent in one place >> mm/mremap: start addresses are properly aligned >> mm/mremap: use pmd_addr_end to simplify the calculate of extent >>=20 >> include/linux/huge_mm.h | 2 +- >> mm/huge_memory.c | 8 +------- >> mm/mremap.c | 27 ++++++++++----------------- >> 3 files changed, 12 insertions(+), 25 deletions(-) >>=20 --=20 Wei Yang Help you, Help me