From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bg5.exmail.qq.com (bg5.exmail.qq.com [43.155.80.173]) (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 A44DE379C5A for ; Mon, 29 Jun 2026 01:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=43.155.80.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782697463; cv=none; b=iZ7fd+vL/X6jK7Kn0lLYGddr6CYJoWGp32pdEMdBZSYSO6NWhDm+7j8Wh3DqhP8ISqSji81fA43RGHGk1Ugpe5D28ywPMi4pOnGkDcxeYcIF8tEKBJU2nk3jqe2cAmmrKZiShx0obp8GVOxVbQ1BaIBIbSPD1+f6VhdsIwRf6jo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782697463; c=relaxed/simple; bh=FlRh5F5Q1l02cX8Dzo3nUXNvQKy8xBB+PoDplx8juc8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=T3u/rBZzLlmNRb81ZQYWl3/3DEFC/GMfn06jylcP2AshMCgH90+WvRAK+rWntxL9/IvjfYANDMPbrrP+RAUXnlRSarZwD0a03U6SZ2GsQ+4GBOWwTd/z84QQ3+ti2ZCTKyfBd8yRoRkm+s6sLIBNIHK6Xx5cBIRucvEY6ahUOxc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com; spf=pass smtp.mailfrom=uniontech.com; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b=cPDXtC5z; arc=none smtp.client-ip=43.155.80.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=uniontech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=uniontech.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=uniontech.com header.i=@uniontech.com header.b="cPDXtC5z" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniontech.com; s=onoh2408; t=1782697407; bh=Uc1Ld065hr1gRHTkui+Guns6DTSEmDDj1S30yTITQzM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=cPDXtC5zcw2PHo1qkk0RqdpZVm6/iFIkCJoWmmoBVgHkmrk+ET7+b1tFXm7OdA6py Tmw6ylJnABtnQZ3tLW3AIkqazJPgiTSJx3IqbPeuQ0OO960Gg9EqPy71RIZFZURqmC psHD/v/Bd/DHFh29NeA+hh104eGeBMVG28r3/wDM= X-QQ-mid: zesmtpsz7t1782697402t391bf88b X-QQ-Originating-IP: hxYqzIMZWgQ7Q3tSJr+siWYgsBO9R7FinesGjRAZvb8= Received: from uniontech.com ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 29 Jun 2026 09:43:19 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 1 X-BIZMAIL-ID: 12751322897713847131 EX-QQ-RecipientCnt: 7 From: Yichong Chen To: akpm@linux-foundation.org Cc: vishal.moola@gmail.com, ye.liu@linux.dev, zhen.ni@easystack.cn, chenyichong@uniontech.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 0/3] tools/mm/page_owner_sort: fix filtering and cleanup issues Date: Mon, 29 Jun 2026 09:43:13 +0800 Message-Id: <20260629014316.130307-1-chenyichong@uniontech.com> X-Mailer: git-send-email 2.20.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: zesmtpsz:uniontech.com:qybglogicsvrgz:qybglogicsvrgz3a-0 X-QQ-XMAILINFO: MFW1oUNkf1TffUmHRn97ag5mNlU2Xj45OYa0AjbZ9mTkb/NJoAfKt+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PAM: 0 Hi, Resend the page_owner_sort cleanup series with corrected threading. This version replaces the single patch currently queued in mm-new by splitting the cleanup into smaller patches and adding the search_pattern() bounds fix. Patch 1 renames is_need() to filter_record() and makes the filter path return explicit results. Patch 2 fixes the per-record allocation leaks. Patch 3 bounds search_pattern() output copies, addressing the pre-existing issue reported by Sashiko/AI review. Changes in v5: - Resend the series with corrected threading. - Keep Ye Liu and Zhen Ni copied, as Andrew requested. - Add patch 3 to bound search_pattern() output copies. Changes in v4: - Split the filter_record() cleanup into a separate patch. - Mention the is_need() to filter_record() rename in the commit log. - Add Reviewed-by from Vishal. Changes in v3: - Keep the free in add_list(), since incomplete records are not included in list_size and cannot be reached by the common cleanup path. - Return explicit error, skip, and match results from filter_record() to handle a NULL return from get_comm(). Changes in v2: - Wrap commit message lines to approximately 75 columns. - Use "Yichong Chen" as the author name. Yichong Chen (3): tools/mm/page_owner_sort: return explicit filter results tools/mm/page_owner_sort: free per-record allocations tools/mm/page_owner_sort: bound pattern output copies tools/mm/page_owner_sort.c | 86 ++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 17 deletions(-) -- 2.51.0