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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CA80C3A589 for ; Tue, 20 Aug 2019 13:18:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 085CF22DA9 for ; Tue, 20 Aug 2019 13:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbfHTNSk (ORCPT ); Tue, 20 Aug 2019 09:18:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:56360 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729409AbfHTNSk (ORCPT ); Tue, 20 Aug 2019 09:18:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D0EACAC50; Tue, 20 Aug 2019 13:18:38 +0000 (UTC) From: Vlastimil Babka To: linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, "Kirill A. Shutemov" , Michal Hocko , Mel Gorman , Matthew Wilcox , Vlastimil Babka Subject: [PATCH v2 0/4] debug_pagealloc improvements through page_owner Date: Tue, 20 Aug 2019 15:18:24 +0200 Message-Id: <20190820131828.22684-1-vbabka@suse.cz> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2: also fix THP split handling (added Patch 1) per Kirill The debug_pagealloc functionality serves a similar purpose on the page allocator level that slub_debug does on the kmalloc level, which is to detect bad users. One notable feature that slub_debug has is storing stack traces of who last allocated and freed the object. On page level we track allocations via page_owner, but that info is discarded when freeing, and we don't track freeing at all. This series improves those aspects. With both debug_pagealloc and page_owner enabled, we can then get bug reports such as the example in Patch 4. SLUB debug tracking additionaly stores cpu, pid and timestamp. This could be added later, if deemed useful enough to justify the additional page_ext structure size. Vlastimil Babka (4): mm, page_owner: handle THP splits correctly mm, page_owner: record page owner for each subpage mm, page_owner: keep owner info when freeing the page mm, page_owner, debug_pagealloc: save and dump freeing stack trace .../admin-guide/kernel-parameters.txt | 2 + include/linux/page_ext.h | 1 + mm/Kconfig.debug | 4 +- mm/huge_memory.c | 4 + mm/page_owner.c | 123 +++++++++++++----- 5 files changed, 100 insertions(+), 34 deletions(-) -- 2.22.0