From patchwork Wed Oct 31 12:59:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schwidefsky X-Patchwork-Id: 10662619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 848BB13BF for ; Wed, 31 Oct 2018 13:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73F662AD46 for ; Wed, 31 Oct 2018 13:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68AC42AD44; Wed, 31 Oct 2018 13:00:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E67202AD21 for ; Wed, 31 Oct 2018 13:00:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB2796B0279; Wed, 31 Oct 2018 09:00:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C5ABF6B028C; Wed, 31 Oct 2018 09:00:11 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B22556B028E; Wed, 31 Oct 2018 09:00:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id 835B76B0279 for ; Wed, 31 Oct 2018 09:00:11 -0400 (EDT) Received: by mail-ot1-f70.google.com with SMTP id f26so7795474otl.20 for ; Wed, 31 Oct 2018 06:00:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:content-transfer-encoding:mime-version; bh=x1vXX/0iqfwSEYhaeftTaYkuO6Tw7aII9Bc8Ctiwk4U=; b=FCv1LFWWFK7Hi/KLLKbhdsKJjzxNuwVLMvriSE8sbcIG22UxFseZ/PLuJQzNCSm1+8 m/vZrPmYRoLhnhEl138cprMJR7vyTvqQWPrzaeJP67DgwbEPg2ZymMPxtzs4rFY/OFJ0 0HPTyk56m/L/+LRkRo+y+vY5HD1sF0tnCi1P+1tnUWoeoTyyM6zzbp8Sfs6n1OYC6raE xC7VydZTAABLLLWpaLjLYT2UGS92ieggGjdPZJ/xP0LD4U3dahH5JYXiOpeAyWSc+R7W qx53aOykC6zsc1qK8ADd3UKrIntGEjO8+XiA+Ls12/SznGqkdbrxyJtxnC+Klq9O81su rOAw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of schwidefsky@de.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=schwidefsky@de.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com X-Gm-Message-State: AGRZ1gKQIxfvxMtcxIPVXh7B0bIX6rn39+l/i1Py/yAsubxfl34DNnyq lhnYhb6/DLRvpMlvyhWSfhhBw4knOxhWDytIdZ5900EQGAYkbxC0d8HTB4iz143cWrv3z7w4ux8 GCj0tCnnb0qefxD3Nj2HittTR6D6EQX81KrvAFR+ulw8+Un9oVwmvpgDJHLKY1fF/7w== X-Received: by 2002:aca:afd0:: with SMTP id y199-v6mr1600239oie.322.1540990811199; Wed, 31 Oct 2018 06:00:11 -0700 (PDT) X-Google-Smtp-Source: AJdET5dGr1a+OBoOioEOE4Z3LTOsuqp0YVQhEn6eGBrfzV/n08GBOe2MCrjKWEIfr2PuMEmGX8Pu X-Received: by 2002:aca:afd0:: with SMTP id y199-v6mr1600208oie.322.1540990810484; Wed, 31 Oct 2018 06:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540990810; cv=none; d=google.com; s=arc-20160816; b=KoSe8V2heRjf/GQ+BQ9saANYHa0Shc6RrDgcRmYSAwGflFuh7sty2zUwmq2KGj3t6G enaYIbci/Cj8tpNwhcE6zLZUIHtTJPWqnVf9yrgCvu0zPcGsBS/nbypsDZRSzGVEaF7/ lNq6rD72N0dVar2V/eLG3ri0jeWHxZ+cFveNqEW5SZFA4HMV17kMwAWhgE4sVw78smfg pOmGzuN34TX0aTg4ClX0f7odK+LnSwKEzSHUFnm3F86M1DamirQbqpLE2/H60hwxmaAA AarHbi4AIFoaj50lSsWVHm3HywdLHKmm+BZg8zHJdID9Mv0q62uNSjqLOdkpMOEcvH5o XJ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:message-id:date:subject:cc :to:from; bh=x1vXX/0iqfwSEYhaeftTaYkuO6Tw7aII9Bc8Ctiwk4U=; b=Z3NiWcBjSGkPUXeEPuWCFExJNWKPLeieOJ6gGjnlZwl/LfZqqoQcm7BzX/oqhF6MNo Bn7xf4iak+frKDzmVsMW08k9KVWtpyW98DmUFXuRixxSo9ACcoUp0JN33k/3A+jAQmF0 K4UdBaXUkHS3vGv4qHO7x1MMMcrfNQ1K66xbOqjqFZ2uUUfRYGyl7wnMsmpN9tbHN7Xz 6T96QQjlFk1L8VpdHdHMuSCYOveGyd5Xh15v8V4GsL/IQtc4eth9o2qLgO60RnGWhKmz TBQy4um1k2GSxKQYtXmYTvgwmV7cqlbL1MkYldTURoGa3mE8Y2NG1j5piJcaaXFpQUhI +nmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of schwidefsky@de.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=schwidefsky@de.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com. [148.163.156.1]) by mx.google.com with ESMTPS id y127-v6si3237745oia.189.2018.10.31.06.00.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 06:00:10 -0700 (PDT) Received-SPF: pass (google.com: domain of schwidefsky@de.ibm.com designates 148.163.156.1 as permitted sender) client-ip=148.163.156.1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of schwidefsky@de.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=schwidefsky@de.ibm.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9VCx5mn110152 for ; Wed, 31 Oct 2018 09:00:09 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2nfbgy4656-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 31 Oct 2018 09:00:08 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Oct 2018 13:00:06 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 31 Oct 2018 13:00:03 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9VD02WO41091274 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Oct 2018 13:00:02 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50C0811C04C; Wed, 31 Oct 2018 13:00:02 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A44B11C050; Wed, 31 Oct 2018 13:00:02 +0000 (GMT) Received: from mschwideX1.boeblingen.de.ibm.com (unknown [9.152.212.164]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 31 Oct 2018 13:00:01 +0000 (GMT) From: Martin Schwidefsky To: Li Wang , Guenter Roeck , Janosch Frank , "Kirill A. Shutemov" , Heiko Carstens , linux-kernel , Linux-MM Cc: Martin Schwidefsky Subject: [PATCH 0/4] pgtable bytes mis-accounting v3 Date: Wed, 31 Oct 2018 13:59:57 +0100 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18103113-0028-0000-0000-000003109524 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18103113-0029-0000-0000-000023CCC563 Message-Id: <1540990801-4261-1-git-send-email-schwidefsky@de.ibm.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-31_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=590 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810310109 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Greetings, version #3 of the fix for the pgtable_bytes mis-accounting problem on s390. Three times is a charm.. Changes v2 -> v3: - Add a fourth patch to redefine __PAGETABLE_PxD_FOLDED as non-empty - Move mm_pxd_folded() to include/asm-generic/pgtable.h and use __is_defined() again with the redefined __PAGETABLE_PxD_FOLDED - Add a missing mm_inc_nr_puds() in arch/s390/mm/pgalloc.c Changes v1 -> v2: - Split the patch into three parts, one patch to add the mm_pxd_folded helpers, one patch to use to the helpers in mm_[dec|inc]_nr_[pmds|puds] and finally the fix for s390. - Drop the use of __is_defined, it does not work with the __PAGETABLE_PxD_FOLDED defines - Do not change the basic #ifdef'ery in mm.h, just add the calls to mm_pxd_folded to the pgtable_bytes accounting functions. This fixes the compile error on alpha (and potentially on other archs). Martin Schwidefsky (4): mm: make the __PAGETABLE_PxD_FOLDED defines non-empty mm: introduce mm_[p4d|pud|pmd]_folded mm: add mm_pxd_folded checks to pgtable_bytes accounting functions s390/mm: fix mis-accounting of pgtable_bytes arch/arm/include/asm/pgtable-2level.h | 2 +- arch/m68k/include/asm/pgtable_mm.h | 4 ++-- arch/microblaze/include/asm/pgtable.h | 2 +- arch/nds32/include/asm/pgtable.h | 2 +- arch/parisc/include/asm/pgtable.h | 2 +- arch/s390/include/asm/mmu_context.h | 5 ----- arch/s390/include/asm/pgalloc.h | 6 +++--- arch/s390/include/asm/pgtable.h | 18 ++++++++++++++++++ arch/s390/include/asm/tlb.h | 6 +++--- arch/s390/mm/pgalloc.c | 1 + include/asm-generic/4level-fixup.h | 2 +- include/asm-generic/5level-fixup.h | 2 +- include/asm-generic/pgtable-nop4d-hack.h | 2 +- include/asm-generic/pgtable-nop4d.h | 2 +- include/asm-generic/pgtable-nopmd.h | 2 +- include/asm-generic/pgtable-nopud.h | 2 +- include/asm-generic/pgtable.h | 16 ++++++++++++++++ include/linux/mm.h | 8 ++++++++ 18 files changed, 61 insertions(+), 23 deletions(-)