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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5463EC43334 for ; Thu, 14 Jul 2022 15:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239169AbiGNPph (ORCPT ); Thu, 14 Jul 2022 11:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiGNPpf (ORCPT ); Thu, 14 Jul 2022 11:45:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 031BEAE4E for ; Thu, 14 Jul 2022 08:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657813533; 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: in-reply-to:in-reply-to:references:references; bh=/dzIwA4vz64Fdq+Tec7zAI7IQ5K1OCYtjvQ2rzb36hs=; b=DsYEujlzYulUcmYfnNdw8LLUx8anYfvcgDzGMYpKssrYQHIRbaNWdoyTEQFK5KSOpIaqSv b79LqTfdSYdImb/8pX0oeavQFWUJcWAGwoU8JLP73oV9hYKPVsUbbhu+BEQrNuR69KrBqt PA30BqDMYq2oIbVAJVGXAt7sgytb39A= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-yAej7VN4OSKnoci9ODsLlg-1; Thu, 14 Jul 2022 11:45:32 -0400 X-MC-Unique: yAej7VN4OSKnoci9ODsLlg-1 Received: by mail-qv1-f70.google.com with SMTP id li2-20020a0562145e0200b0047350bbed70so1448513qvb.19 for ; Thu, 14 Jul 2022 08:45:32 -0700 (PDT) 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=/dzIwA4vz64Fdq+Tec7zAI7IQ5K1OCYtjvQ2rzb36hs=; b=vxvAbUkq5hBqJs+mfT905dzFEJsXVJ0EoBJ7ntTKzAGJyKRW1cQ/u66LNuiEKky96d BK5eaWBoyjf+1rZmoJQeBXldJIWYI7ZTrKkKrBDVRj6NzpkpBaeo+bVMrXMqAkMKIxPq 2EAFMvVBYt9kz2tRETyB6onHHCDq+fyY8OCk6krIu28kBrRkA6R1IRifoXvUQLS+bTVh 7oRN293dlTq0V8dex+4JJ8QL/uH2DixtzA6Bn4/sLZz5JKKWX5C8OA1XGJDcqH+ZN3g9 DW4pnqRPQHHHlfw/1Lxl7mKdf9UlrPTiIp/duUH1JES9OiLA33fnNjjtet1+DUoDwNy6 jqhw== X-Gm-Message-State: AJIora8eCQQK/HoE3r3aU3rMCysAX1oBdihKQ/FySjF+SHwBi7AXDjNU uolv8sKdSJZn//bZ2A2Qfx34w23lm7SW4lHh57r8XJU2x6cRueKCDqtJYsAoKgyklpooDzZlqJ0 zZOpG6zTkQ+QSJ3JJ8H7csuf9 X-Received: by 2002:a0c:8084:0:b0:472:f26b:59f7 with SMTP id 4-20020a0c8084000000b00472f26b59f7mr8127384qvb.62.1657813531942; Thu, 14 Jul 2022 08:45:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6oEt31b5+FHGmtHxJUjLrXvN2EA7KeRUBkXyvC1Ec9eZLkht9J5r7hUNUwO6xniY/dDBq8Q== X-Received: by 2002:a0c:8084:0:b0:472:f26b:59f7 with SMTP id 4-20020a0c8084000000b00472f26b59f7mr8127369qvb.62.1657813531765; Thu, 14 Jul 2022 08:45:31 -0700 (PDT) Received: from xz-m1.local (bras-base-aurron9127w-grc-37-74-12-30-48.dsl.bell.ca. [74.12.30.48]) by smtp.gmail.com with ESMTPSA id w22-20020ac843d6000000b0031eb02307a9sm1708746qtn.80.2022.07.14.08.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:45:31 -0700 (PDT) Date: Thu, 14 Jul 2022 11:45:29 -0400 From: Peter Xu To: Miaohe Lin Cc: Axel Rasmussen , Mike Kravetz , Andrew Morton , Muchun Song , Linux MM , LKML Subject: Re: [PATCH] mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte Message-ID: References: <20220712130542.18836-1-linmiaohe@huawei.com> <1a27f20c-ed69-398a-5e6d-bb7ec5f14f5f@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1a27f20c-ed69-398a-5e6d-bb7ec5f14f5f@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 14, 2022 at 06:09:49PM +0800, Miaohe Lin wrote: > As discussed in another thread, we might call page_dup_file_rmap for newly > allocated page (regardless of this patch). So should we come up a seperate > patch to call page_add_file_rmap here instead? Hmm, why we need page_add_file_rmap() even if a new page allocated? Say, we're at least also using page_dup_file_rmap() in hugetlb_no_page(). I see majorly two things extra there: memcg accounts on NR_FILE_MAPPED, and mlock. But I assume both of them will not apply to hugetlb pages? -- Peter Xu