From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755865AbdKCJUy (ORCPT ); Fri, 3 Nov 2017 05:20:54 -0400 Received: from mga14.intel.com ([192.55.52.115]:27880 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755794AbdKCJUw (ORCPT ); Fri, 3 Nov 2017 05:20:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,338,1505804400"; d="scan'208";a="917176228" Date: Fri, 3 Nov 2017 12:20:49 +0300 From: "Kirill A. Shutemov" To: Heiko Carstens Cc: Andrew Morton , linux-mm@kvack.org, linux-next@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Hocko , Gerald Schaefer , Martin Schwidefsky Subject: Re: [PATCH] s390/mm: fix pud table accounting Message-ID: <20171103092048.ozmskabkq5rrwizz@black.fi.intel.com> References: <20171103090551.18231-1-heiko.carstens@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171103090551.18231-1-heiko.carstens@de.ibm.com> User-Agent: NeoMutt/20170714-126-deb55f (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 03, 2017 at 09:05:51AM +0000, Heiko Carstens wrote: > With "mm: account pud page tables" and "mm: consolidate page table > accounting" pud page table accounting was introduced which now results > in tons of warnings like this one on s390: > > BUG: non-zero pgtables_bytes on freeing mm: -16384 > > Reason for this are our run-time folded page tables: by default new > processes start with three page table levels where the allocated pgd > is the same as the first pud. In this case there won't ever be a pud > allocated and therefore mm_inc_nr_puds() will also never be called. > > However when freeing the address space free_pud_range() will call > exactly once mm_dec_nr_puds() which leads to misaccounting. > > Therefore call mm_inc_nr_puds() within init_new_context() to fix > this. This is the same like we have it already for processes that run > with two page table levels (aka compat processes). > > While at it also adjust the comment, since there is no "mm->nr_pmds" > anymore. Thanks for tracking it down. Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov