Received: by 10.223.185.116 with SMTP id b49csp6729372wrg; Wed, 28 Feb 2018 14:34:19 -0800 (PST) X-Google-Smtp-Source: AG47ELspn8bEBn0Njr8dzUCAPnP1/YUzIwu5t7GyxV204MHlG/uqUAlla319O21qsZKOl2W52FoO X-Received: by 2002:a17:902:50ec:: with SMTP id c41-v6mr4223167plj.208.1519857259156; Wed, 28 Feb 2018 14:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519857259; cv=none; d=google.com; s=arc-20160816; b=NqYwOUFwvcx1zcjBaPZJQ1Rb+QjfX6/soqQxR5MhNFh9yynZIcjj8lUvqooNKXZpgT Oh4mnOvJkj8mCAiXyRQEmDO/FwYY/U/QmU8ZxRgwjuxaFu0jcaPjEpVBLQG1I4hiTIHC hM8aiX/f7oW++OH36TCZgtNZ41F5FuOKXkZGY+R5aE1z1hiN00ezthQpdasdw4gLsCm/ zU1RUheWitoxZt4AeodsvOdhz6n7fyLS2w4IA+DETBNy/kKQwpdrktJIdH1Ygs1isa6N +HLqnTDVl8Ze+9ejcNbTI4WoEP3jJDStOS++w50y+ovw7p71XC7v9nmknDp5QBTmpIG5 6O+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cuk8CquywIpo+3U/Mz8ftJ0bVsdwyQp89g7Cis978zw=; b=ILej9a1l/oN2P6fRTO6sWY53B+/4XWiRJKxkXdQGY5aw14/f5mcxXvAEY5dgE2R1lN UEgewH73ubfOLdZ2QKKoZn/6vr6U3iG1CF6r2JOtI+nEJ0R1we1DyO56AvXTFrqe8pRJ TroMyRkV1sWHMcfUNt3ImjsAGwHWcgxc9ELi5Bg2Dl08M7KCCBI6+Tpnsa3i0eBd1EEj sPdXA3TzvNw7lfhRxK+pjFVCyQSze/rOaMRge20zYhfa6gqBvL/PwtOsOOXojvFgFJKP ryLjOuq1GBrfcBSuCcOqfjnrd4LDL+U4jUx87h+OM5BCztcSNnlUzanaWIYNy+mR86kN 1n+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SnOoNZ2Z; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si1840668pff.233.2018.02.28.14.34.04; Wed, 28 Feb 2018 14:34:19 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=SnOoNZ2Z; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935534AbeB1Wcr (ORCPT + 99 others); Wed, 28 Feb 2018 17:32:47 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:44488 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935455AbeB1WcK (ORCPT ); Wed, 28 Feb 2018 17:32:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=cuk8CquywIpo+3U/Mz8ftJ0bVsdwyQp89g7Cis978zw=; b=SnOoNZ2ZPcU/TPn8BPyEe9tfh jjMPl+f321yaMn999Ay04zz9yBTYZfiNxexpk7JPEuAqXyW3nu6suJb4PygPp1unwr13Z9abK7ICd k7CTUdRujTWp78pd0GbVpl7tBj40LgYI8sm/BiaFt/LBsLnXaqc8Ax5R0+lhP0+nfX3GMk+HiuDS1 Nlr4gO2PxnNdT4XTI4N0N0btmsxLCBsm1IhzPwx639DAvUHIKHwlu+r4laSVODP54OF847vCLull4 mTf17eVUtqWeBJa/YLAOfLGvn6ObC+cDPd3D7aUqh92rhTm8hzG0eruxdfWV6iJxXaOwsgUqrjwBJ 4Xjl4TV4g==; Received: from willy by bombadil.infradead.org with local (Exim 4.89 #1 (Red Hat Linux)) id 1erAGd-0002Zu-Nj; Wed, 28 Feb 2018 22:32:07 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Cc: Matthew Wilcox , Martin Schwidefsky , linux-kernel@vger.kernel.org Subject: [PATCH v3 3/4] mm: Mark pages allocated through vmalloc Date: Wed, 28 Feb 2018 14:31:56 -0800 Message-Id: <20180228223157.9281-4-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180228223157.9281-1-willy@infradead.org> References: <20180228223157.9281-1-willy@infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Wilcox Use a bit in page_type to mark pages which have been allocated through vmalloc. This can be helpful when debugging or analysing crashdumps. Signed-off-by: Matthew Wilcox --- include/linux/page-flags.h | 6 ++++++ mm/vmalloc.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d151f590bbc6..8142ab716e90 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -643,6 +643,7 @@ PAGEFLAG_FALSE(DoubleMap) #define PG_buddy 0x00000080 #define PG_balloon 0x00000100 #define PG_kmemcg 0x00000200 +#define PG_vmalloc 0x00000400 #define PageType(page, flag) \ ((page->page_type & (PAGE_TYPE_BASE | flag)) == PAGE_TYPE_BASE) @@ -681,6 +682,11 @@ PAGE_TYPE_OPS(Balloon, balloon) */ PAGE_TYPE_OPS(Kmemcg, kmemcg) +/* + * Pages allocated through vmalloc are tagged with this bit. + */ +PAGE_TYPE_OPS(Vmalloc, vmalloc) + extern bool is_free_buddy_page(struct page *page); __PAGEFLAG(Isolated, isolated, PF_ANY); diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ebff729cc956..3bc0538fc21b 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1536,6 +1536,7 @@ static void __vunmap(const void *addr, int deallocate_pages) struct page *page = area->pages[i]; BUG_ON(!page); + __ClearPageVmalloc(page); __free_pages(page, 0); } @@ -1705,6 +1706,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, area->nr_pages = i; goto fail; } + __SetPageVmalloc(page); area->pages[i] = page; if (gfpflags_allow_blocking(gfp_mask|highmem_mask)) cond_resched(); -- 2.16.1