Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7639805rwn; Wed, 14 Sep 2022 01:55:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4u4c6tr9ar1RxVQypKSf2kBAsb5P7XTLQu7hR1kx9pMTnT4eiOUxEe8Fgtvy3Uz5hYdKfV X-Received: by 2002:a17:906:9c82:b0:6e1:1d6c:914c with SMTP id fj2-20020a1709069c8200b006e11d6c914cmr24469452ejc.769.1663145756556; Wed, 14 Sep 2022 01:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663145756; cv=none; d=google.com; s=arc-20160816; b=hgekrTYYcoTNNc0dFoyM/RYMfXFk3Esohpq3/ARYycQWAZ+SOfNuXKUMaRIWC86gA4 Q515G+PNSYe2sjp8a15SJ2sRj5+PiBJm/uonNLeQuTcn6eDLYyF1gYSzDcgC3K1Fmh8N Xyrfu7q3iE/ztI/G6p06ShZgwf49LXPuFWQOsfom6SHfrbEvRZW1Zpq2kRodjQjh2GdR 88Edf3YClYjYT1KBUoZyNQI7X4YLJXnj3TwRbnofC4lcGiJonUolXGi8pl4yeEAV8CX4 w+qGEKZs18OdWKqmak6qmKvI9w+D28YI+AQtvUu/IQy1wACKjhy4CNMQfuwOtfGlOPiX EdUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7FbP/ITfgbOj5FbBPVf14A+eusiOzt/7bzMLu+ikvdA=; b=nut5MDaYSy08J72IrD2KyaIlccNsjamET0sNYpUM2jN9E5UZ1/O/LxK+X4ho2EBuyX GAycdqV9Chl0m8O2PAeQO8j51IP1a6l56Hs1uRminWYHxIo2wQguS4A5fTtk0hPe11o0 BaTdAOxYvKBt1ptHKTXJdO6Ut2TwkGnzFWh0lsXSKWGVqs49ye7a0imWza9CCbvr83n/ 5aXYP9/ZUk9q3CmqwI+/9Wb+bQ303/NUDvTJ9Gpwp1WEjWh2vGD24FMFQeUbUuDf/KL5 nznnKgMozm6Ehd7CfeBl67WMDcEamubTJRCaWHyuaMvBiGA1Qb9WcDqu/XxgOuHUEdXg T/zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AYi1h6FG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a0564020e0800b00452154c138dsi5193193edh.330.2022.09.14.01.55.30; Wed, 14 Sep 2022 01:55:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=AYi1h6FG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230121AbiINI1K (ORCPT + 99 others); Wed, 14 Sep 2022 04:27:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiINI1G (ORCPT ); Wed, 14 Sep 2022 04:27:06 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FBCD6527C for ; Wed, 14 Sep 2022 01:27:03 -0700 (PDT) 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> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.