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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B135C00140 for ; Tue, 2 Aug 2022 14:59:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C18D6B0071; Tue, 2 Aug 2022 10:59:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04AA38E0002; Tue, 2 Aug 2022 10:59:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE01C8E0001; Tue, 2 Aug 2022 10:59:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CAB596B0071 for ; Tue, 2 Aug 2022 10:59:36 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A733C1C64D5 for ; Tue, 2 Aug 2022 14:59:36 +0000 (UTC) X-FDA: 79754961552.13.CB157D2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 00F71C0044 for ; Tue, 2 Aug 2022 14:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659452375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TiEVWlyldriK6u+7IZclS64oyMv2tQAk41MyojiltD4=; b=hy8pn/cbvBX0kEdiSVCh/smgAkI+pvRli0UxJq9YHGTSGsrGZtCVavRkmvt6KUpD/n/WEK Z+UYNzzFV3UbPwtPcp9bly/1YFYALwMp2godAn/WKVQ4qSRetuCqVy88lSGTM3YQ0q2CWL LT4d3SR1GOha0ir3ZjE3XycsRI8Hen0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-256-4D51CW6gPCyFmZvOPofHVg-1; Tue, 02 Aug 2022 10:59:34 -0400 X-MC-Unique: 4D51CW6gPCyFmZvOPofHVg-1 Received: by mail-wm1-f70.google.com with SMTP id v64-20020a1cac43000000b003a4bea31b4dso4727098wme.3 for ; Tue, 02 Aug 2022 07:59:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:organization:in-reply-to :content-transfer-encoding; bh=TiEVWlyldriK6u+7IZclS64oyMv2tQAk41MyojiltD4=; b=doKKc7Cpn8coBk/kA4q9RbCs/N2GirbMsGlo8iYIDkjCGCmua5yoRAaffb/lMmepXq x7iMF+ulvY3iwSe2EXINabEnU3TFuUijsRYGiKoe1luZdjeB29DMk4HHm9S9EtwdWnbc yUhyTT+YSkPNCJwXb4l4ISkMei5QQP5PecLZrzzrgxh6HFSNfkqaZX3DYP7t5hUR+wU8 s6q8CX6Q98hNNSyyfLmfAp466Alch9u+yr+L0EoBPBKtxQOgswpLPPwDtk2MUBUe4vXJ Eu4yrC1vv7AVAyU1nAx8+9S5i9i98nwkis3s3aqOwQHDW55Pc0Cfm4wCRNptO4FgJdyM VzIQ== X-Gm-Message-State: AJIora8FZ0EXbxAiUaAfvMru+Zch9oYahi27VmBr3sOOZC5SE7v/ivxL xE9MhqBtL08vFz2lncHV3X3Bms2mT6jdiglsDD7abjF9DH9IxIquxpJyfIDwUzkNeuq+e6/UMza pY6DhWkj7b4M= X-Received: by 2002:a05:600c:a41:b0:39c:1512:98bd with SMTP id c1-20020a05600c0a4100b0039c151298bdmr14793138wmq.88.1659452373042; Tue, 02 Aug 2022 07:59:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uVcy9Uhg/u4K309FT0W3bmnAaw4bdK83/8GL9sXHMylj8ESdtJLqkyEA7z9bDjEmji9qyLrA== X-Received: by 2002:a05:600c:a41:b0:39c:1512:98bd with SMTP id c1-20020a05600c0a4100b0039c151298bdmr14793119wmq.88.1659452372798; Tue, 02 Aug 2022 07:59:32 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:3800:8435:659e:f80:9b3d? (p200300cbc70738008435659e0f809b3d.dip0.t-ipconnect.de. [2003:cb:c707:3800:8435:659e:f80:9b3d]) by smtp.gmail.com with ESMTPSA id u11-20020a056000038b00b0021e4829d359sm16597094wrf.39.2022.08.02.07.59.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Aug 2022 07:59:32 -0700 (PDT) Message-ID: <01362246-05e6-f57f-9f64-c8d2524e685d@redhat.com> Date: Tue, 2 Aug 2022 16:59:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] mm: Split huge PUD on wp_huge_pud fallback To: "Gowans, James" , "linux-mm@kvack.org" , "christian.koenig@amd.com" , "linux-kernel@vger.kernel.org" , =?UTF-8?B?U2Now7ZuaGVyciwgSmFuIEgu?= , "thomas.hellstrom@linux.intel.com" , "akpm@linux-foundation.org" References: <6f48d622eb8bce1ae5dd75327b0b73894a2ec407.camel@amazon.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <6f48d622eb8bce1ae5dd75327b0b73894a2ec407.camel@amazon.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659452376; a=rsa-sha256; cv=none; b=EBpz0jzigyl4J5YUFRZ5mqdxE4q8Jv/ecPeTS6pzJXYE/X5rYd0ZlgG3i+Dq3FIgyrJtXA LifsXZt1wTrpHBKVNaWkhjBbdK0THq7HdkEzUYHG8EnjlpS8N7RDf+7KrGO3bCbn3qtKxf 9jzAKxWY8GDV5C8uhEfwf3oPkKCd+bc= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="hy8pn/cb"; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659452376; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=TiEVWlyldriK6u+7IZclS64oyMv2tQAk41MyojiltD4=; b=Zb1+mEESxyb4Vgexhk2g7YVbCOv2PRYnHHKY7Dw2ExkQIZLy2DnBrXbesiEmMelUl6QIb4 bxuy2Ke2i27eOIy3PiPSAB99eooZBxdXZ2lYriYKshzR13I7WqZwfjyJ8Qj5mwZ6i8TA3d YQ/n8gAbP8dRwaD9VcwXAhJ7Vn6plyE= X-Stat-Signature: aa5cah9i8zojy54f43i4pxy5ysqfqtqb X-Rspamd-Queue-Id: 00F71C0044 X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="hy8pn/cb"; spf=pass (imf22.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam03 X-HE-Tag: 1659452375-804111 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 23.06.22 07:24, Gowans, James wrote: > Currently the implementation will split the PUD when a fallback is taken > inside the create_huge_pud function. This isn't where it should be done: > the splitting should be done in wp_huge_pud, just like it's done for > PMDs. Reason being that if a callback is taken during create, there is > no PUD yet so nothing to split, whereas if a fallback is taken when > encountering a write protection fault there is something to split. > > It looks like this was the original intention with the commit where the > splitting was introduced, but somehow it got moved to the wrong place > between v1 and v2 of the patch series. Rebase mistake perhaps. > > Fixes: 327e9fd48972 ("mm: Split huge pages on write-notify or COW") Right, the functions should just look like create_huge_pmd()/wp_huge_pmd(). I do wonder if there was a reason to do it differently, though ... I can't spot any in current code. Acked-by: David Hildenbrand -- Thanks, David / dhildenb