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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B01AEC433E0 for ; Fri, 10 Jul 2020 08:14:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3F3A02078B for ; Fri, 10 Jul 2020 08:14:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="CXjTDGyU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F3A02078B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 77B2C6B0002; Fri, 10 Jul 2020 04:14:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 72AAB8D0001; Fri, 10 Jul 2020 04:14:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 618736B0006; Fri, 10 Jul 2020 04:14:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 502566B0002 for ; Fri, 10 Jul 2020 04:14:38 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E2CCF18029DB8 for ; Fri, 10 Jul 2020 08:14:37 +0000 (UTC) X-FDA: 77021454594.12.pump82_031460b26ecc Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id B0CDD18013510 for ; Fri, 10 Jul 2020 08:14:37 +0000 (UTC) X-HE-Tag: pump82_031460b26ecc X-Filterd-Recvd-Size: 4940 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Fri, 10 Jul 2020 08:14:37 +0000 (UTC) Received: by mail-lf1-f46.google.com with SMTP id d21so2711764lfb.6 for ; Fri, 10 Jul 2020 01:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=EdqYNjnn4lFnDb/Ltl3KnhokXyLvpEwpSaEOucEsDeQ=; b=CXjTDGyUkcbgXKv4Qefq/jkn6TTSEZ65GZRlyaUe9sNQkeXIZOocWKy+0KuaYGdSVV MBMrfNZUPp3xKF0DBbqPpxiuk5yUEQMhL7bE391khlQIMLtot4+Qh3hyXg7Aq/3cb8Kf hgmoAM6a7diDOgTv2UwrvxGppkos5FF1ycsco+lQ/pzODcNptrQ9pmlqaOqKMhd5lQYJ /UsX2L8Og7LX3VT3TJ1e1LlgMRh8FNA0tGX4VxSN15Cl2czArgt1GNRouXO+Bb9QaUoM oTR4QQXuXPcYwPfcZA/5sT8/AXAjfjrV70jXDgE9Z1jv4z8Y7VDSS9jEioJDA7IM0F9U 1+Iw== 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:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=EdqYNjnn4lFnDb/Ltl3KnhokXyLvpEwpSaEOucEsDeQ=; b=Ua98/XP/27r0GGrYWFTaKD4kLLlWsL903pfsk+JqqEjdx+Ww+lGR+DO6AF4aLzLZXb Klc0ICcnH58WfW20shJFskyC5/+BePWuXLd8d0YPNBsU6Lp6/O+HTns0EuYMmTHSQCsW HD1biOM5Hxsa1jhdkZnYSxNf3UMHXQN6piP+o4PPBxod+xF4JYXhuJ5iJA8OWa5k9A9A ZqqgvCz0nC9VnTNh6JSoVDMQW6f+nN5MYPcylOJVeebUpWKi2g4s90pQBHzNn1XdjcYj jQlZnj5qFP1Pcj8i6V4sGGMsSrE7qekGVvp2s1cWZBrt+zVVT2xc7MeU7IsoohBx1Oxd JODw== X-Gm-Message-State: AOAM532MkvOkrkZzkzrkmi+YUvrH3LATFwg/ggy+1YyXatbOxpivetgf e6d8cl58KAUw775kh7tPbnc7xA== X-Google-Smtp-Source: ABdhPJzJ+asruIY1JGYqEOmk9ijAqDtgjs0Gka4N81Senyhf3C/IPjxWcoT9T4BKvPOgZZQDaTJ0qg== X-Received: by 2002:a19:ecc:: with SMTP id 195mr42789720lfo.71.1594368875511; Fri, 10 Jul 2020 01:14:35 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id i8sm1654396ljg.57.2020.07.10.01.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 01:14:34 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id BC1F610222B; Fri, 10 Jul 2020 11:14:36 +0300 (+03) Date: Fri, 10 Jul 2020 11:14:36 +0300 From: "Kirill A. Shutemov" To: Wei Yang Cc: Dmitry Osipenko , 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: <20200710081436.3f75omeq5xpjeoc6@box> References: <20200708095028.41706-1-richard.weiyang@linux.alibaba.com> <3cab86b0-586e-781b-1620-f28b00c57d44@gmail.com> <20200710011410.GC51939@L-31X9LVDL-1304.local> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200710011410.GC51939@L-31X9LVDL-1304.local> X-Rspamd-Queue-Id: B0CDD18013510 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 Fri, Jul 10, 2020 at 09:14:10AM +0800, Wei Yang wrote: > 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 s= hould be > >> PMD aligned. But current code calculate old range and new range sepa= rately. > >> This leads to some redundant check and calculation. > >>=20 > >> This cleanup tries to consolidate the range check in one place to re= duce 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 > > >=20 > Ah, my bad, I forget the error we met last time. It is the different fo= rmat of > pmd_addr_end. >=20 > Sorry for that. >=20 > @ Kirill >=20 > If you agree, I would leave the extent/next calculation as it is in pat= ch 3. Okay. --=20 Kirill A. Shutemov