Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2072150lqt; Sun, 21 Apr 2024 23:49:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEtu718cquXO4IzO2pv81B9sE2ce73JnRxsP42ntGaFPXkPPBe45/AKZXHRgX3Jjywg/UPSF6u7hwC58jC8Vv81zUnYZFkhIQpGQaXUA== X-Google-Smtp-Source: AGHT+IGzNwKTHOSi6DZfs2ogGEbprNSOhdtaQSgRzlVKTuz8awc+C5C+E5Mxtp+p3TjVZMhddD+k X-Received: by 2002:ad4:4684:0:b0:6a0:5344:aed4 with SMTP id pl4-20020ad44684000000b006a05344aed4mr9963216qvb.5.1713768587589; Sun, 21 Apr 2024 23:49:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713768587; cv=pass; d=google.com; s=arc-20160816; b=IHyNx9RjsXhnEfqy4OmhVgSN3IEQjKcsdGOFL3KCHeLihbVxN7UhAmv43NyEmguJt4 U+aGVKCVGbUUH2ekumQjrhsIktLjhb6YndsK84PtSpTQwOQ8TQ58Knn4BgRdSow6CXgC jvQWEH6vL8vcvLHyBFr7tfKxLczH1bBgOBPDKTh+qYvOC8GEgruF8gnHlGUsD7ZIBaYx t0m6iPV4gCSd5URPPifdNeAxUMtDxalYochLtrlSzvkT+2SfyPG2/4t0SYBss+c1grcY 0nNs3upt+WUZw69syFCMsJ1aZ5wOD6Mk6BGVY/iP2GrtdASb39ld4PYkYdRZORiB0tGr ewog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=M4r8qRC3GMq/V9Nvk3gHKxi0DstITpx7E6gXzk5LZpI=; fh=cs5ZGs+e4aFUcpr9Xfd8YsPKY0b0fVuQq5irqnVSJao=; b=mopp0LYQCUk0sjbm7S6tzlkrAnGVwa8UQ4av+7hy+WtlsmXObHOtzO1WvQS9oIXoQN kFLrOVA/UPyq2zMhOoHD8fAt4apckcM4wzVpr/RZf9NXLitjT5D1n/d5XMMTlL5uGRwe 6Cw1PmrbTucYIMkNOk+iHNnEPro4hTJAFpP3F/AqBNWXAuof8wK2y5WHGwsMjNvmC30A T4M/MhnwfGv41R8vF7V8Wy5HDsw5Bg5p4gYdACECkGWcCJ7VpotL9gUdC9Chd6LfbA1+ ef+SVzbgwZ8hvQqkW8t2OmD+gwjZNBavWB17uNlE9EcVNruv6LsvubqQzsRlwmGFDK7x ANYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=xJMeSNUS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-152803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hr11-20020a05621423cb00b006a085b097bfsi156431qvb.592.2024.04.21.23.49.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Apr 2024 23:49:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=xJMeSNUS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-152803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 51F141C20C46 for ; Mon, 22 Apr 2024 06:49:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A71CD481CD; Mon, 22 Apr 2024 06:49:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="xJMeSNUS" Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EC5B3FB09 for ; Mon, 22 Apr 2024 06:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713768580; cv=none; b=kulnInIEAp0JZsfnY5X96BvR95F4vBOW9t33uWfYPIctaB+F25wE5mD9odTuIQ5qxDcCsysBRrAB372caREKd+TknMhVS/ZERVPI2sUy+u4ZlJRXEXwe7P/iTyo3EIjHp43F5aaI0o/BuEmeac3X7wmhDHJv6djiPpp/1Ej0v0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713768580; c=relaxed/simple; bh=9aKSLviQppqudi7UA0uw6NzOwMoyu+iWPQ0UiXM2u/c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GH9vGwhtkZi06izLciuY+1wDzvxKZeLqAL1muLz2eMYKHVYMuFuUvB4+QTauokHWvEuAyiDMJ6Vrc9JyNqXea8rx/NV5edMBafspe+RtJaLSowfhObntQ/j4odDUgQKtpU7PWS6DYaG9iGliEro+Kt524hN4WIrg1mG+pkM0tEc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=xJMeSNUS; arc=none smtp.client-ip=115.124.30.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1713768575; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=M4r8qRC3GMq/V9Nvk3gHKxi0DstITpx7E6gXzk5LZpI=; b=xJMeSNUSWM5482mR8zGS1LAQv1lrkQImFuqmDSLSqzRU1qCNFehglDqvfmaL3UMFgYRWAXKiJGFlnkmUGBo3LOIKQK6rhqi+bXie7de7tRPHMiUZgzarlexxFPUdfDS6wd0LAM9T+issR+DKoLt1HU+axJgxeFaoaCdA0t1/kVE= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R891e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0W5.HVkq_1713768573; Received: from 30.97.56.56(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W5.HVkq_1713768573) by smtp.aliyun-inc.com; Mon, 22 Apr 2024 14:49:34 +0800 Message-ID: <653923bb-51dc-40c1-aa88-276c71a333a4@linux.alibaba.com> Date: Mon, 22 Apr 2024 14:49:33 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: huge_memory: add the missing folio_test_pmd_mappable() for THP split statistics To: Lance Yang Cc: david@redhat.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240422061720.61697-1-ioworker0@gmail.com> From: Baolin Wang In-Reply-To: <20240422061720.61697-1-ioworker0@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/4/22 14:17, Lance Yang wrote: > Hey Baolin, > > Maybe I spotted a bug and made a change to this patch as follows. > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 824eff9211db..f3c4e08c6d30 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -2994,6 +2994,7 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, > XA_STATE_ORDER(xas, &folio->mapping->i_pages, folio->index, new_order); > struct anon_vma *anon_vma = NULL; > struct address_space *mapping = NULL; > + int order = folio_order(folio); > int extra_pins, ret; > pgoff_t end; > bool is_hzp; > @@ -3172,7 +3173,7 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, > i_mmap_unlock_read(mapping); > out: > xas_destroy(&xas); > - if (folio_test_pmd_mappable(folio)) > > IIUC, if we split the folio successfully, it won’t be large here. Yes, good catch. I did a blindly copy-paste. Will fix in next version. Thanks for reviewing. > + if (order >= HPAGE_PMD_ORDER) > count_vm_event(!ret ? THP_SPLIT_PAGE : THP_SPLIT_PAGE_FAILED); > return ret; > } > > Thanks, > Lance