Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2166403rdb; Thu, 21 Sep 2023 10:14:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGE8ya9gF01/QSXh2+hcY7OVY3PVTznpVY78wRAMvJtwetMeLs2DkHkT2lkZuDiN8GfYuED X-Received: by 2002:a17:903:25cd:b0:1bb:b855:db3c with SMTP id jc13-20020a17090325cd00b001bbb855db3cmr4783771plb.41.1695316494048; Thu, 21 Sep 2023 10:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695316494; cv=none; d=google.com; s=arc-20160816; b=RKcyhdVEZ6sm+aNxVGfPyRCbNvz4tChnvDkwGKo+D52XaVO6hXTjCQPtdIGo2taLWG u3CHuCFQ8t7abERZzFO/Ms/GpF7o0T5ColqHffMPjIZqulRBxX64Vikf9V03EemuM2S1 BdNmKC9BZMM56eTPvuGmdMlo95DE1AVWDAIWW2YfGibPELSZrhqJSHL31W7wwI2aN7Oc n9ziZtqMGvqIK4MhwmUj3Ljy64SjVN1+1BusDTBMkemitsSmvkl8fc6xoJyUHUb/onv7 Bs7iiXtDm+GsxB26Njc4HuXGqjCX/R/mZin6LK7R9/yOdbR6f09K5d3R2Nbg+szd1Cer xKNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=zSC1wSLCtCSgc8VWe2aXoYvfW28VD0xxRoxySeG8aDE=; fh=V583jWTUF6fI3UzqXkaaWp2LiwXTKZ2UKgM+9cAsa0M=; b=EsJARkhmbS9tmwIC8ogbBSkBpcRg5OZXhM6gNHAyxyunut9hhXNXdLlxjCexJ4tERR 5sFL/6KXg5Pf+re656lFunhNqj4XXjXscUIl07YLpsS5DRCNhXneUwv0ybyb7fGtI992 2/rBWvs0RH18d6Irv6Eq6HQyKCKVS9QFeWokc3fdJF7zRbllNuYkGlKi3zyuD9Welq0f 3K3aO2H7Sf0Y0lzYuzL2bpECVw6BKSblgk+x2p3bXGQ+xlT1VVhLlhk57nikY+YTa0hX AXk7vd6CU4u67MPWdBL3d+PW8Rum/YIEj3hlRSEEEwbBnZ3JCfxQ63hCSijtX//CVDUS vzRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kv11-20020a17090328cb00b001c3cbccf116si1767257plb.403.2023.09.21.10.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 10:14:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 504FC80FF290; Thu, 21 Sep 2023 10:08:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbjIURHg (ORCPT + 99 others); Thu, 21 Sep 2023 13:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbjIURHR (ORCPT ); Thu, 21 Sep 2023 13:07:17 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B370149FC for ; Thu, 21 Sep 2023 10:05:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 85A24176A; Thu, 21 Sep 2023 09:26:23 -0700 (PDT) Received: from [10.1.34.154] (XHFQ2J9959.cambridge.arm.com [10.1.34.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 408773F59C; Thu, 21 Sep 2023 09:25:45 -0700 (PDT) Message-ID: <7aee2aeb-acb2-4fe3-90b5-3dd43ee855c2@arm.com> Date: Thu, 21 Sep 2023 17:25:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: hugetlb: kill set_huge_swap_pte_at() Content-Language: en-GB To: Qi Zheng , mike.kravetz@oracle.com, songmuchun@bytedance.com, akpm@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20220626145717.53572-1-zhengqi.arch@bytedance.com> From: Ryan Roberts In-Reply-To: <20220626145717.53572-1-zhengqi.arch@bytedance.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:08:59 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email On 26/06/2022 15:57, Qi Zheng wrote: > The commit e5251fd43007 ("mm/hugetlb: introduce set_huge_swap_pte_at() > helper") add set_huge_swap_pte_at() to handle swap entries on > architectures that support hugepages consisting of contiguous ptes. > And currently the set_huge_swap_pte_at() is only overridden by arm64. > > The set_huge_swap_pte_at() provide a sz parameter to help determine > the number of entries to be updated. But in fact, all hugetlb swap > entries contain pfn information, so we can find the corresponding > folio through the pfn recorded in the swap entry, then the folio_size() > is the number of entries that need to be updated. > > And considering that users will easily cause bugs by ignoring the > difference between set_huge_swap_pte_at() and set_huge_pte_at(). > Let's handle swap entries in set_huge_pte_at() and remove the > set_huge_swap_pte_at(), then we can call set_huge_pte_at() > anywhere, which simplifies our coding. > > Signed-off-by: Qi Zheng Hi, FYI, I discovered a bug in v6.6-rc1 that causes a kernel panic, which I believe is caused by this change. I've posted a fix along with a detailed explanation at [1]. [1] https://lore.kernel.org/linux-arm-kernel/20230921162007.1630149-1-ryan.roberts@arm.com/ Thanks, Ryan