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 5ED6DECAAD8 for ; Wed, 14 Sep 2022 08:27:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C76186B0074; Wed, 14 Sep 2022 04:27:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFE746B0075; Wed, 14 Sep 2022 04:27:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9F918D0001; Wed, 14 Sep 2022 04:27:03 -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 968556B0074 for ; Wed, 14 Sep 2022 04:27:03 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6E03916071F for ; Wed, 14 Sep 2022 08:27:03 +0000 (UTC) X-FDA: 79910010726.08.3A52D6F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP id DDC0F1600A0 for ; Wed, 14 Sep 2022 08:27:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7FbP/ITfgbOj5FbBPVf14A+eusiOzt/7bzMLu+ikvdA=; b=AYi1h6FG0FChkXsD0MOOKXZ4Zf fgpZHFdM4SWboDJ5G7Vszygks15NHsdcdGYcVohrkmSfp2zVD4rywDfJZDgBG79vby4rEtfK7kdo4 3l/GLj5ZM3LWYCi17dVpUH97uxPILf3PkpoJPBPc1Lx2pLvw4YhgCOL20M/5pGlEfdSBFLPuWLfVn 8Kn5pKjvQ4qJLdbMXV4WJb0EuqciRM0xM+V53DrGARwKplK1S+11v8UA7ESBbO0NbIUlUsGbAhxKx ZOXqct6DgupQBNOELiB496t70kOBSBJ/f/s/cScO8iSCU9AQaU7ZWU91+4g7O3E2tfVncunHQ1W3i GtPIp8XA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYNjP-0000qz-PM; Wed, 14 Sep 2022 08:26:51 +0000 Date: Wed, 14 Sep 2022 09:26:51 +0100 From: Matthew Wilcox To: "zhaoyang.huang" Cc: Andrew Morton , Catalin Marinas , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com Subject: Re: [PATCH 2/2] mm: introduce __GFP_TRACKLEAK to track in-kernel allocation Message-ID: References: <1663126621-26926-1-git-send-email-zhaoyang.huang@unisoc.com> <1663126621-26926-2-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1663126621-26926-2-git-send-email-zhaoyang.huang@unisoc.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663144023; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7FbP/ITfgbOj5FbBPVf14A+eusiOzt/7bzMLu+ikvdA=; b=d4Vv15Qc8jPLJuSVM4OKIeLWvZ5qtqiFyXQ0AX7iLuwUUKSwx6i/y8uVizzCGqu33GNHJb eUFiOt4AYceF6k9NSr3MEXLd8di7RNmYlDh+YdTa/taFY8e1d87wZxI9w545rg8si7WdcZ nhHcC2uanqCtpoJf9jfOKmZNow5hsXc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AYi1h6FG; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663144023; a=rsa-sha256; cv=none; b=zm/JVCLa4uJFGZ5dSCTSM7A1skq0xceYXgVecgni93N+O37T2IiST66KREtlUpk2GZ7qz1 rh1p/wVdvS07EEQ/D6zwyIJFtAeNpzC19mUBLo7vzApRqhQMgF6eSEIjHirkEP6KoBlXbX zG9kvtEgncC9PbqPPiNMniDtl6kKEXQ= Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=AYi1h6FG; spf=none (imf08.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam08 X-Rspam-User: X-Stat-Signature: bs9mqj7361k9exg4zt6qac6m6ydbyuhb X-Rspamd-Queue-Id: DDC0F1600A0 X-HE-Tag: 1663144020-203138 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 Wed, Sep 14, 2022 at 11:37:01AM +0800, zhaoyang.huang wrote: > --- > v2: code update > v3: update code and Documentation This is really not good enough. What changed? The documentation is also not good enough. It needs to mention: - This cannot be used for GFP_HIGHMEM allocations. - This cannot be used for pages which are mapped into userspace. I also still want to see selftests. order-0, order-N (with and without __GFP_COMP). What happens if you allocate an order-N page without GFP_COMP, take an extra ref on the first page, call free_pages() and then one of the recently-freed pages is allocated again while you still have the reference on the first page? I believe Andrew also suggested that if (PageTrackleak(page)) become always-false if the CONFIG option is disabled. > +#ifdef CONFIG_HAVE_DEBUG_KMEMLEAK This is the wrong CONFIG option, it should be CONFIG_DEBUG_KMEMLEAK. Add to this the very real question of how useful is this, and I'm not getting warm fuzzy feelings about where this patchset is heading.