Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5994645ybe; Tue, 10 Sep 2019 11:53:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKkOTtTC8TX39aAcr3xix3r3gwRnCw+0VN6ZegR3men+mtFIMgTthLjTIDKGKy9SwJfc5Z X-Received: by 2002:a50:de8f:: with SMTP id c15mr32833031edl.47.1568141624814; Tue, 10 Sep 2019 11:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568141624; cv=none; d=google.com; s=arc-20160816; b=FuUcbcKantK8T/rcjhATGIEM0VIH6NtHcglVVMCKwAWmbJlJVd6iN9jCfbqDr1JrH6 SiBWxv3I87nU/zF5DX4Jg3HafJGGud1hN9Hgtim2No6wvfLQyL4mnN9w+Flwavm65Oad nICkwkiGXwWv4IF64PjXTrJgFsrBsGTfJNJveXZSMbmjETJjBWXyKtxQ5v3Y/fSmJqey DQKfHTvJb90Vk02e+l0tmX3alSjOS0IeHyPy/r979Z0kmU4IfD70mhV20aAzR2vvo9w/ bG/8u/kTBdceT3dcvoY+m9qloc9ann2/2gUFiDEqqDCquIuIhKaf3pPJp3Udjs/Z7JfZ Xzdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=GVqXqK+To+HnYhWL7Xd++TWKNLkn2xHveC9/Z0dPmjA=; b=OMCY/TQr78ZWc9Q2NlAe46jjiCMzKPGx3+Tjf35jQoWZfjiqfbfe/QWqFdM2oz4HIp Lb8QsDJB83yU5gf+odNjzHQCnrqsdHnf7xmCKWyvra9juCpmbO8ovDenxP66CwvjiXw+ 5FQ9FK1dB4mzz5lPaeoSCYzMnE0V5jU4X7NVYNsZFLomrCNm8gBkHQfKVzTVk0/gJBx8 ol9DNuB8Zeid5+ejUPYgn6ntcyNkxLf3cjYMd42gvo8d44DXcT1E6VJ2ZWfNl+VAew/6 PE2kjNIWfNxBGUUngu5B/cbdoeq5AhitC+A44IgpzIh0qtiZ+y+6/u330yemd9Sban9u G+og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si8229383edq.86.2019.09.10.11.53.21; Tue, 10 Sep 2019 11:53:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391283AbfIJJoJ (ORCPT + 99 others); Tue, 10 Sep 2019 05:44:09 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:44138 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2391245AbfIJJoJ (ORCPT ); Tue, 10 Sep 2019 05:44:09 -0400 X-UUID: 7db3989441fd4168b9615b951f209fdb-20190910 X-UUID: 7db3989441fd4168b9615b951f209fdb-20190910 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1966950674; Tue, 10 Sep 2019 17:44:03 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 10 Sep 2019 17:43:58 +0800 Received: from [172.21.84.99] (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 10 Sep 2019 17:43:58 +0800 Message-ID: <1568108638.24886.7.camel@mtksdccf07> Subject: Re: [PATCH v2 1/2] mm/page_ext: support to record the last stack of page From: Walter Wu To: "Kirill A. Shutemov" CC: David Hildenbrand , Andrey Ryabinin , Alexander Potapenko , "Dmitry Vyukov" , Matthias Brugger , Andrew Morton , Martin Schwidefsky , Will Deacon , Andrey Konovalov , Arnd Bergmann , Thomas Gleixner , Michal Hocko , Qian Cai , , , , , , Date: Tue, 10 Sep 2019 17:43:58 +0800 In-Reply-To: <20190910093103.4cmqk4semlhgpmle@box.shutemov.name> References: <20190909085339.25350-1-walter-zh.wu@mediatek.com> <36b5a8e0-2783-4c0e-4fc7-78ea652ba475@redhat.com> <1568077669.24886.3.camel@mtksdccf07> <20190910093103.4cmqk4semlhgpmle@box.shutemov.name> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2019-09-10 at 12:31 +0300, Kirill A. Shutemov wrote: > On Tue, Sep 10, 2019 at 09:07:49AM +0800, Walter Wu wrote: > > On Mon, 2019-09-09 at 12:57 +0200, David Hildenbrand wrote: > > > On 09.09.19 10:53, Walter Wu wrote: > > > > KASAN will record last stack of page in order to help programmer > > > > to see memory corruption caused by page. > > > > > > > > What is difference between page_owner and our patch? > > > > page_owner records alloc stack of page, but our patch is to record > > > > last stack(it may be alloc or free stack of page). > > > > > > > > Signed-off-by: Walter Wu > > > > --- > > > > mm/page_ext.c | 3 +++ > > > > 1 file changed, 3 insertions(+) > > > > > > > > diff --git a/mm/page_ext.c b/mm/page_ext.c > > > > index 5f5769c7db3b..7ca33dcd9ffa 100644 > > > > --- a/mm/page_ext.c > > > > +++ b/mm/page_ext.c > > > > @@ -65,6 +65,9 @@ static struct page_ext_operations *page_ext_ops[] = { > > > > #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT) > > > > &page_idle_ops, > > > > #endif > > > > +#ifdef CONFIG_KASAN > > > > + &page_stack_ops, > > > > +#endif > > > > }; > > > > > > > > static unsigned long total_usage; > > > > > > > > > > Are you sure this patch compiles? > > > > > This is patchsets, it need another patch2. > > We have verified it by running KASAN UT on Qemu. > > Any patchset must be bisectable: do not break anything in the middle of > patchset. > Thanks your reminder. I should explain complete message at commit log. Our patchsets is below: https://lkml.org/lkml/2019/9/9/104 https://lkml.org/lkml/2019/9/9/123