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 0FB59C54EE9 for ; Wed, 7 Sep 2022 12:52:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A2208D0003; Wed, 7 Sep 2022 08:52:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 650636B0074; Wed, 7 Sep 2022 08:52:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53EBF8D0003; Wed, 7 Sep 2022 08:52:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 44FBC6B0073 for ; Wed, 7 Sep 2022 08:52:12 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 08B47C013A for ; Wed, 7 Sep 2022 12:52:12 +0000 (UTC) X-FDA: 79885277304.31.BCB0D7B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf14.hostedemail.com (Postfix) with ESMTP id DFF2B100078 for ; Wed, 7 Sep 2022 12:52:10 +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=nmR1IiZKgR22rMieRBMYuwwKUcg5yhMaOI/O5H5C9XI=; b=JHOSeaoeI1J4BUNSc93Zoij/tz MU6N5PLFpGlHrMm4VWZhjzlNcewvbjSduvBnKJ8I24LMDcsftiGJE3e0HXXO4yJXiwSn5HSNiq2sR 6t2ZzeR/LootwwGwU3OfbcyqGLb252oOrlggrjNhj1bkZTx1REhSi10s19Prvg3tXhl35B9XjaAXD 2IUwa52cwDCCfY0uq5GPT8v/RQEAYSMmmtkG3eUrwFZTSjfVQPwFMae+xEVsEWcj3ipyi867+x5nX jtHMrj6+jDKDzpuWbrYsTAJw5MnHMVSke/EFnFBZ2ACl2caicyDYx6IhMFjALZHpMiKQkSbN7YNI3 Fbu+Kg9A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVuXA-00BMUu-0R; Wed, 07 Sep 2022 12:52:00 +0000 Date: Wed, 7 Sep 2022 13:51:59 +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: [PATCHv2] mm: introduce __GFP_TRACKLEAK to track in-kernel allocation Message-ID: References: <1662544357-26649-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1662544357-26649-1-git-send-email-zhaoyang.huang@unisoc.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662555131; a=rsa-sha256; cv=none; b=wiiLKmzTQCl8jzAmQ7y9wHSri614xNGAmo08QsQMBSghbRzOHK2ON54J2Abpx+jZWSz8TZ aRScsa8e07jnqn8xt6g3n71vHWG63vJ34yKILi9lOxrnvSgZHWGsfhI85yl4DdA7lXnrSS d9HRJk76HpBwUvsvXzSkkn9fX5sJVm0= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JHOSeaoe; spf=none (imf14.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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662555131; 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=nmR1IiZKgR22rMieRBMYuwwKUcg5yhMaOI/O5H5C9XI=; b=lOCPIg3hJ3o0kV2Mmr/maYxDHywdvtqE6tjd38aYicFqVDQ+5OvIcBKoy4bUKH/1NpYcEW vdcUc5bBokDdJ7pYdDennHGl/5NJ4o+Z6baXD1mXaKeAeaQfyFOpcgiEyaAccvvztqjOLJ TslxwKnX+9k+6pPLVy/M7G5KSDznqq4= X-Stat-Signature: hs1jfecautehfj8f13jxe13hjx3he5u8 X-Rspamd-Queue-Id: DFF2B100078 Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=JHOSeaoe; spf=none (imf14.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: rspam01 X-Rspam-User: X-HE-Tag: 1662555130-395997 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 07, 2022 at 05:52:37PM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Kthread and drivers could fetch memory via alloc_pages directly which make them > hard to debug when leaking. Solve this by introducing __GFP_TRACELEAK and reuse > kmemleak mechanism which unified most of kernel cosuming pages into kmemleak. As I said in my response to v1, this needs (a) documentation and (b) tests.