From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:57796 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752968AbcDDSp4 (ORCPT ); Mon, 4 Apr 2016 14:45:56 -0400 Date: Mon, 4 Apr 2016 11:45:45 -0700 From: Greg KH To: Gerald Schaefer Cc: "# v4 . 3+" Subject: Re: [PATCH] numa: fix /proc//numa_maps for THP Message-ID: <20160404184545.GB32131@kroah.com> References: <1459783440-13748-1-git-send-email-gerald.schaefer@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1459783440-13748-1-git-send-email-gerald.schaefer@de.ibm.com> Sender: stable-owner@vger.kernel.org List-ID: On Mon, Apr 04, 2016 at 05:24:00PM +0200, Gerald Schaefer wrote: > In gather_pte_stats() a THP pmd is cast into a pte, which is wrong because the > layouts may differ depending on the architecture. On s390 this will lead to > inaccurate numap_maps accounting in /proc because of misguided pte_present() > and pte_dirty() checks on the fake pte. > > On other architectures pte_present() and pte_dirty() may work by chance, but > there may be an issue with direct-access (dax) mappings w/o underlying struct > pages when HAVE_PTE_SPECIAL is set and THP is available. In vm_normal_page() > the fake pte will be checked with pte_special() and because there is no > "special" bit in a pmd, this will always return false and the VM_PFNMAP | > VM_MIXEDMAP checking will be skipped. On dax mappings w/o struct pages, an > invalid struct page pointer would then be returned that can crash the kernel. > > This patch fixes the numa_maps THP handling by introducing new "_pmd" variants > of the can_gather_numa_stats() and vm_normal_page() functions. > > Signed-off-by: Gerald Schaefer > Cc: # v4.3+ What is the git commit id of this in Linus's tree? thanks, greg k-h