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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,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 8FB97C2D0D2 for ; Fri, 20 Dec 2019 15:55:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 489DC21D7E for ; Fri, 20 Dec 2019 15:55:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=shipmail.org header.i=@shipmail.org header.b="TjvMiIej" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 489DC21D7E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D37818E01A0; Fri, 20 Dec 2019 10:55:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE9F08E019D; Fri, 20 Dec 2019 10:55:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFF6A8E01A0; Fri, 20 Dec 2019 10:55:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id AB9648E019D for ; Fri, 20 Dec 2019 10:55:00 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 369E5181AEF09 for ; Fri, 20 Dec 2019 15:55:00 +0000 (UTC) X-FDA: 76285968360.16.rat14_2b69594537311 X-HE-Tag: rat14_2b69594537311 X-Filterd-Recvd-Size: 3707 Received: from pio-pvt-msa2.bahnhof.se (pio-pvt-msa2.bahnhof.se [79.136.2.41]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Dec 2019 15:54:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 7EAFB3F76A; Fri, 20 Dec 2019 16:54:56 +0100 (CET) Authentication-Results: pio-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=TjvMiIej; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yDT3YremuHvA; Fri, 20 Dec 2019 16:54:55 +0100 (CET) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by pio-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id A757C3F5D4; Fri, 20 Dec 2019 16:54:54 +0100 (CET) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id E7330362158; Fri, 20 Dec 2019 16:54:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1576857293; bh=dh0iOkelcGLbAowahmsupk/G5uFo11djWIGikieW09g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=TjvMiIej3WKfCTNKKBket9vK9kUw2WaxcPusZmwdhhpQq8vKoRj8/rrlyfjWESb7V +plX6u+EcOriAPTTNoaq/rGIiB5SvExgu6fC3FBPysf9h4HRTiLDXYDVBV4BiPVu+L goF34lR6seDAv3zNoQW/U+W+TIKKz101D+VWmcXE= Subject: Re: [PATCH] mm/hmm: Cleanup hmm_vma_walk_pud()/walk_pud_range() To: Steven Price , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20191220153826.24229-1-steven.price@arm.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <0d648083-2664-f99c-f1d7-4655e66b3a5b@shipmail.org> Date: Fri, 20 Dec 2019 16:54:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20191220153826.24229-1-steven.price@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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 12/20/19 4:38 PM, Steven Price wrote: > There are a number of minor misuses of the page table APIs in > hmm_vma_walk_pud(): > > If the pud_trans_huge_lock() hasn't been obtained it might be because > the PUD is unstable, so we should retry. > > If it has been obtained then there's no need for a READ_ONCE, and the > PUD cannot be pud_none() or !pud_present() so these paths are dead code= . > > Finally in walk_pud_range(), after a call to split_huge_pud() the code > should check pud_trans_unstable() rather than pud_none() to decide > whether the PUD should be retried. > > Suggested-by: Thomas Hellstr=C3=B6m (VMware) > Signed-off-by: Steven Price > --- > This is based on top of my "Generic page walk and ptdump" series and > fixes some pre-existing bugs spotted by Thomas. > > mm/hmm.c | 16 +++++----------- > mm/pagewalk.c | 2 +- > 2 files changed, 6 insertions(+), 12 deletions(-) LGTM. Reviewed-by: Thomas Hellstrom