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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 DFEEDC34031 for ; Wed, 19 Feb 2020 02:10:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4F1F6207FD for ; Wed, 19 Feb 2020 02:10:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F1F6207FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A36256B0003; Tue, 18 Feb 2020 21:10:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9E6B06B0006; Tue, 18 Feb 2020 21:10:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D5976B0007; Tue, 18 Feb 2020 21:10:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0173.hostedemail.com [216.40.44.173]) by kanga.kvack.org (Postfix) with ESMTP id 725D26B0003 for ; Tue, 18 Feb 2020 21:10:03 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F0D228248047 for ; Wed, 19 Feb 2020 02:10:02 +0000 (UTC) X-FDA: 76505246244.19.shoes49_1d4f7af60f756 X-HE-Tag: shoes49_1d4f7af60f756 X-Filterd-Recvd-Size: 2218 Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Feb 2020 02:10:01 +0000 (UTC) Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2128C5D71AAFCBFCA923; Wed, 19 Feb 2020 10:09:57 +0800 (CST) Received: from [127.0.0.1] (10.177.246.209) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Wed, 19 Feb 2020 10:09:47 +0800 Subject: Re: [PATCH] mm/hugetlb: avoid get wrong ptep caused by race To: Matthew Wilcox CC: , , , , , , , References: <1582027825-112728-1-git-send-email-longpeng2@huawei.com> <20200218205239.GE24185@bombadil.infradead.org> From: "Longpeng (Mike)" Message-ID: <593d82a3-1d1e-d8f2-6b90-137f10441522@huawei.com> Date: Wed, 19 Feb 2020 10:09:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200218205239.GE24185@bombadil.infradead.org> Content-Type: text/plain; charset="gbk" X-Originating-IP: [10.177.246.209] X-CFilter-Loop: Reflected 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: =D4=DA 2020/2/19 4:52, Matthew Wilcox =D0=B4=B5=C0: > On Tue, Feb 18, 2020 at 08:10:25PM +0800, Longpeng(Mike) wrote: >> { >> - pgd_t *pgd; >> - p4d_t *p4d; >> - pud_t *pud; >> - pmd_t *pmd; >> + pgd_t *pgdp; >> + p4d_t *p4dp; >> + pud_t *pudp, pud; >> + pmd_t *pmdp, pmd; >=20 > Renaming the variables as part of a fix is a really bad idea. It obscu= res > the actual fix and makes everybody's life harder. Plus, it's not even > renaming to follow the normal convention -- there are only two places > (migrate.c and gup.c) which follow this pattern in mm/ while there are > 33 that do not. >=20 Good suggestion, I've never noticed this, thanks. By the way, could you give an example if we use this way to fix the bug? >=20 > . >=20 --=20 Regards, Longpeng(Mike)