Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp32662069rwd; Fri, 7 Jul 2023 18:55:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlFfyqprBWzNIj2Pz5HNPV/qwHt1vuWsvAELhjkZA8w2mGfbN+3yhKzqkQuce9f/8EcDfyuZ X-Received: by 2002:aa7:c544:0:b0:51e:1bf3:f4ac with SMTP id s4-20020aa7c544000000b0051e1bf3f4acmr4510000edr.27.1688781345418; Fri, 07 Jul 2023 18:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688781345; cv=none; d=google.com; s=arc-20160816; b=F+HyLF8aqUmTcMiQr/6Nn631Oq9pmKNn+hGiX0ORxyxVyxDEhnzkHvhpEULduVO4eH 6e+BvDKnL+6Kkwy1jetPIqZUIqa77vLC3+a2JSnBqTuhO8BnDIyPD45ryZcwMMknjjjI jYdaWokjWPZeGhl6HJbXFubqfmHNoJcZHtQxMR2EizVKYdhjbQh14vByXTsWq9GsBAIq Tn4cw11mPu7Pjzu9ggVHq3Cvn+tYRbQJrqlAofEwQ6wHAVwdc7Zal8KbjyO5U2jhzx1L jcXhD8N8BTCpTaED8Ayfg6DCI94BQ5SMmXyYtuTfU7XifOmBsppUGQb3HZrsouv15rpf S+KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=qRhfBAQl1hCC0Cjr0rsZo9q87R9bFpiUUmeqFf16aAI=; fh=KGpHpXUIljnYbgnJNQw4Y+z2TpIvGXyEuPMozS5s1Kw=; b=hcRGauYqH4g5UUYIgf/TjW6YxPpSMLjl+ZtbdQI/HYiQbQNTD+yIOGLNKJR45l7aig lr2k+Gm5pwQSI9cL/u2EAAk8ynKWK8nDlrUyOSCQA+HXDTnJXhapQWbhNU4SvrZpWj5O iEN6nTx9NlQjQEq9QUE3q+wFnMRAHBgh9dXAHWQ9lIFFRMMazml90o0jkUIDgoXf5iN3 Idpb6PXR/rOr++qJyksodycGjZCBsOFzXvzvxk5mguDT3E9cNYRtqtlmK9jf455EDltg xBZEmLW9eDqJIkbhn43s9S3J47ukGKIoWw2o55nEpLeqhU1PEIxpp/82MsvYXLUNGGsu nZ3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dci2ghm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n4-20020aa7c684000000b0051e059448c9si2622648edq.387.2023.07.07.18.55.21; Fri, 07 Jul 2023 18:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dci2ghm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjGHBlP (ORCPT + 99 others); Fri, 7 Jul 2023 21:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbjGHBlO (ORCPT ); Fri, 7 Jul 2023 21:41:14 -0400 Received: from out-4.mta0.migadu.com (out-4.mta0.migadu.com [91.218.175.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF9F19B2 for ; Fri, 7 Jul 2023 18:41:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1688780468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qRhfBAQl1hCC0Cjr0rsZo9q87R9bFpiUUmeqFf16aAI=; b=Dci2ghm98pi89aXcedutDYqUEZXyeEMztVc+komY2Jimt6OHtnWxnVgYpKyjfGsW2nSS/A OB31R2Jm6LIzmLLgRD/dCefNzt/Ru0fDsACzh+XSrmwQMEHQi8ttG1toWKmJhYxAR/fBrl h5uJEzwpOtNKr2vnVeZT5XZp+4JYtsA= MIME-Version: 1.0 Subject: Re: [PATCH] mm: hugetlb_vmemmap: fix a race between vmemmap pmd split X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20230707124116.d7be4ba6504a452d11e2629d@linux-foundation.org> Date: Sat, 8 Jul 2023 09:40:30 +0800 Cc: Muchun Song , Mike Kravetz , Linux Memory Management List , LKML Content-Transfer-Encoding: quoted-printable Message-Id: <07A5567A-8BED-40DB-88F4-96C37DCD78BF@linux.dev> References: <20230707033859.16148-1-songmuchun@bytedance.com> <20230707124116.d7be4ba6504a452d11e2629d@linux-foundation.org> To: Andrew Morton X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 8, 2023, at 03:41, Andrew Morton = wrote: >=20 > On Fri, 7 Jul 2023 11:38:59 +0800 Muchun Song = wrote: >=20 >> And inline __split_vmemmap_huge_pmd() >> since it only has one user. >=20 > "open code" would be a better term than "inline" in this situation. >=20 > If we are to offer this change to -stable then it would be better to = do > the open-coding of __split_vmemmap_huge_pmd() in a separate, later > patch. >=20 I see. Bug fix is better to "open code" instead of "inline". However, it is a simpler and cleaner way to fix this bug by using "inline". Because we must hold init_mm.page_table_lock to get the page table page in = __split_vmemmap_huge_pmd(), then it is just a couple of duplicated code from split_vmemmap_huge_pmd(). Consequently, = split_vmemmap_huge_pmd() is redundant, just remove it. And rename __split_vmemmap_huge_pmd() to split_vmemmap_huge_pmd(). The result is the same as the "inline" way. So I keep "inline" to fix this. Thanks.