Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2732792iog; Mon, 27 Jun 2022 01:31:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u3ZEK+KYDan+f5kFo9+yKFuuM3CYK90wp/qHpsGd5rjYa3N35Wwou0PV4LisFUgx6Fd+Ru X-Received: by 2002:a17:90b:4a0c:b0:1ec:d90c:601d with SMTP id kk12-20020a17090b4a0c00b001ecd90c601dmr14462196pjb.154.1656318694064; Mon, 27 Jun 2022 01:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656318694; cv=none; d=google.com; s=arc-20160816; b=tEX7yZjLGC+iC9ZXg5a8yxh7FTaYjWrDJtFYTpz5EWMQ8BhgNRPAdA7FYecOiO9iUN RWW0U6Qmnchxi8kM2E0EqbMJVBpWZ7tsFl0J3bnYluG9nQg3c2ZmhE5PsQ1SQfbvWHfy PjK/IAFLJUwPMsQ8HGDxlJ0lmgZXVIa5ECTC1Rjgl6k0WdSdVmMy7VOkA1F5f6Tn9rDj aagYLdQ6yHPEBuhaTI4pLlCtGNMdCg7UeVj4xDwkMPiI8uX3hV/k+ddWLc8iJz2fRb99 ybxYeQJcoO9o9pkWDLn4AxIIZP+iOZNymJbnfE911sSVZwWI22FtP5llwVtZStMrYoNI 2GFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jyqDF5Hpn2EUBCZeMxGZtJnLwcRJ4sS1ucd+2BRdDk4=; b=sOdqA0u6Fkgw7MahvUjMG/AxvlBFc63tmODjttr7Zq9rqyCwIPH6BAoizi9p3p7YrN q/yv+WWhSLRkj/xv6Z5/HSZfqyG4dfyWH6T/KX4zKNjgysen7ajgyfHgkC20Fp1eaOJi bmvep/ekgbbYJy90jVuIgsns9yRlafeRgbAaYAkYfPvxrNof41tYDtgnhCTZfmhaBGfD KHlyA2Im0Wvwbn0YZtkyyVRVIdsL6HRl5DgidxwqdUi0QTdm5qk8wUXTkSkvRmehz1R4 AMf49d/Fr3O943D1RIwd62No0QKUpELjX5O65WVf/tyPhUHso3m87LcpMNfPeTI72BcP 9Smg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=qzPhTTdi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170902b08800b0016a57bbd34esi13353661plr.412.2022.06.27.01.31.22; Mon, 27 Jun 2022 01:31:34 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=qzPhTTdi; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbiF0H5a (ORCPT + 99 others); Mon, 27 Jun 2022 03:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233215AbiF0H53 (ORCPT ); Mon, 27 Jun 2022 03:57:29 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0456160E8 for ; Mon, 27 Jun 2022 00:57:29 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 68so8359394pgb.10 for ; Mon, 27 Jun 2022 00:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jyqDF5Hpn2EUBCZeMxGZtJnLwcRJ4sS1ucd+2BRdDk4=; b=qzPhTTdiRDFzMFpwSdyKg8WpEavFtchGHpONzR7KAUt3FNXZ5+gup4HUqmgGm1ShjR cVmoJXM4C2NMJPbwsZxSQzBcyxRtIySH2B2CpFoa7uRPwEpPZ9UPPBOiPL0d9tccG6an 2KB8Yw46giMPSF6DpW7z7dkklmbQMOqQQylX+YZ7+yBwTP0rWPMlygxf6tm4l2R9Ior5 9LaJdfmQpr/67qZpPCmS3okU49W3CRUPsD0elkSwsH+m3Ke5+C01OnJ480UCXsUa9GMi BZm3j9qs2UeLTBZBAHXfAyFK5C3hEt4/sgzOb8d9ID0/tetPn6iUPrhRhEj1WM0k4TU1 XSaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jyqDF5Hpn2EUBCZeMxGZtJnLwcRJ4sS1ucd+2BRdDk4=; b=MThoNcHkALfXqs+s10NHh/WPoKrj/LUcMKzzU2ApPfJuRTSQB2SybDH2g1qx4KuguZ nFUqReLYe/0nakT0Z2rhNLkBzWkK7YsE98dIstXq8usxTqGQM7hNQcgLuT4HP4GKtc1v 4hc57U50a30D6VISeOqNWdZhoc1s3xx7zFksOsjIfEc9HV8zc6FW65YwVDYO2gsz7RhD PsjHBwTwiLUVsQEqvzp2mtIr+Pob9iRRDq4ahORk5x9DyjP4TbCZMlGdkWzqNtQwWtl7 Z+E3s2IERFeDIGDV6nJT21PKvHkee+3wjlqXYIT94vcHuRy6xwWBjh/Uw5bYZB6JE0G3 G4qA== X-Gm-Message-State: AJIora/w2V+VajfQuHemBQJUovXoJyBcVqyUYDDJEfaD++I635XpSKBV DBJBxDwTULQuijpUSedpgTYF5g== X-Received: by 2002:aa7:9f9b:0:b0:525:1e0a:a6b4 with SMTP id z27-20020aa79f9b000000b005251e0aa6b4mr13623307pfr.5.1656316648483; Mon, 27 Jun 2022 00:57:28 -0700 (PDT) Received: from localhost ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id f11-20020a62380b000000b0051829b1595dsm6491342pfa.130.2022.06.27.00.57.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 00:57:28 -0700 (PDT) Date: Mon, 27 Jun 2022 15:57:25 +0800 From: Muchun Song To: Naoya Horiguchi Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Mike Kravetz , Miaohe Lin , Liu Shixin , Yang Shi , Oscar Salvador , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/9] mm/hugetlb: separate path for hwpoison entry in copy_hugetlb_page_range() Message-ID: References: <20220623235153.2623702-1-naoya.horiguchi@linux.dev> <20220623235153.2623702-3-naoya.horiguchi@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220623235153.2623702-3-naoya.horiguchi@linux.dev> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Fri, Jun 24, 2022 at 08:51:46AM +0900, Naoya Horiguchi wrote: > From: Naoya Horiguchi > > Originally copy_hugetlb_page_range() handles migration entries and hwpoisone > entries in similar manner. But recently the related code path has more code > for migration entries, and when is_writable_migration_entry() was converted > to !is_readable_migration_entry(), hwpoison entries on source processes got > to be unexpectedly updated (which is legitimate for migration entries, but > not for hwpoison entries). This results in unexpected serious issues like > kernel panic when foking processes with hwpoison entries in pmd. > > Separate the if branch into one for hwpoison entries and one for migration > entries. > > Fixes: 6c287605fd56 ("mm: remember exclusively mapped anonymous pages with PG_anon_exclusive") > Signed-off-by: Naoya Horiguchi Thanks for fixing it. Reviewed-by: Muchun Song