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=-5.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 8C612C433E0 for ; Wed, 12 Aug 2020 13:53:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4A516206B2 for ; Wed, 12 Aug 2020 13:53:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="WbIaItY9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4A516206B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AEC598D001C; Wed, 12 Aug 2020 09:53:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A757B8D0001; Wed, 12 Aug 2020 09:53:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93D8E8D001C; Wed, 12 Aug 2020 09:53:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0025.hostedemail.com [216.40.44.25]) by kanga.kvack.org (Postfix) with ESMTP id 77AFF8D0001 for ; Wed, 12 Aug 2020 09:53:08 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 88006249F for ; Wed, 12 Aug 2020 13:53:07 +0000 (UTC) X-FDA: 77142058014.15.brick11_480b32026fec Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 4A35A1814B0C1 for ; Wed, 12 Aug 2020 13:53:07 +0000 (UTC) X-HE-Tag: brick11_480b32026fec X-Filterd-Recvd-Size: 6414 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 13:53:06 +0000 (UTC) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 07CDoDW7003112; Wed, 12 Aug 2020 09:53:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=mbKPENaagQmcQKyWye+84+hFtC0+dYiCzSCHlpzsLCs=; b=WbIaItY9I9FUfYAWYVCuED3T2URI0Q+nte/N+EzHcJ/WOh32n8VlkLYewXvSaUdPLU5F Eu2B3wWVluvwuLWAAAMJwtzZnt0YozKVnD1BJjUJAQBeYbpzEURQIn7WEb/0u0efGbY0 BOU2EZCX/Alpcvrb83Wgv6SbRRrbT3+j0fktsr+OQo+5pwyvCwvmCjDifU4ernGSTg+e Dokd+NEkZ8IWd5LGIiOWSFirLuVqC5EL6XX6EBv+VvykCvHEfQ4Lgi2unlggOwO8LHeG ZC1IMIyx6kyXYnhMzVBHmxEEwuY9Ka5b1wPQMasqs3/bEUXgPnZYIRqjKg7/XEkJtSEi Ng== Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 32t93sa6ym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 09:52:59 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 07CDoaf0012346; Wed, 12 Aug 2020 13:52:55 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma05fra.de.ibm.com with ESMTP id 32skp82s77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Aug 2020 13:52:54 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 07CDqqpa59638178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Aug 2020 13:52:52 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8CFF4C04A; Wed, 12 Aug 2020 13:52:52 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 618594C040; Wed, 12 Aug 2020 13:52:51 +0000 (GMT) Received: from [9.85.71.17] (unknown [9.85.71.17]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 12 Aug 2020 13:52:51 +0000 (GMT) Subject: Re: [PATCH 14/16] debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64 To: Anshuman Khandual , linux-mm@kvack.org, akpm@linux-foundation.org Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org References: <20200812063358.369514-1-aneesh.kumar@linux.ibm.com> <20200812063358.369514-14-aneesh.kumar@linux.ibm.com> <83766a01-6ffb-798c-c5b9-46b2d672f618@arm.com> From: "Aneesh Kumar K.V" Message-ID: <535169b9-f4f0-57ce-0c2b-30afc237d4bd@linux.ibm.com> Date: Wed, 12 Aug 2020 19:22:50 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <83766a01-6ffb-798c-c5b9-46b2d672f618@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-12_06:2020-08-11,2020-08-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008120096 X-Rspamd-Queue-Id: 4A35A1814B0C1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 Content-Transfer-Encoding: quoted-printable 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: On 8/12/20 7:04 PM, Anshuman Khandual wrote: >=20 >=20 > On 08/12/2020 06:46 PM, Aneesh Kumar K.V wrote: >> On 8/12/20 6:33 PM, Anshuman Khandual wrote: >>> >>> >>> On 08/12/2020 12:03 PM, Aneesh Kumar K.V wrote: >>>> The seems to be missing quite a lot of details w.r.t allocating >>>> the correct pgtable_t page (huge_pte_alloc()), holding the right >>>> lock (huge_pte_lock()) etc. The vma used is also not a hugetlb VMA. >>>> >>>> ppc64 do have runtime checks within CONFIG_DEBUG_VM for most of thes= e. >>>> Hence disable the test on ppc64. >>> >>> This test is free from any platform specific #ifdefs which should >>> never be broken. If hugetlb_advanced_tests() does not work or is >>> not detailed enough for ppc64, then it would be great if you could >>> suggest some improvements so that it works for all enabled platforms. >>> >>> >> >> As mentioned the test is broken. For hugetlb, the pgtable_t pages shou= ld be allocated by huge_pte_alloc(). We need to hold huget_pte_lock() bef= ore=C2=A0 updating huge tlb pte. That takes hugepage size, which is mostl= y derived out of vma. Hence vma need to be a hugetlb vma. Some of the fun= ctions also depend on hstate. Also we should use set_huge_pte_at() when s= etting up hugetlb pte entries. I was tempted to remove that test complete= ly marking it broken. But avoided that by marking it broken on only PPC64= . >=20 > The test is not broken, hugetlb helpers on multiple platforms dont comp= lain about > this at all. The tests here emulate 'enough' MM objects required for th= e helpers > on enabled platforms, to perform the primary task i.e page table transf= ormation it > is expected to do. The test does not claim to emulate a perfect MM envi= ronment for > a given subsystem's (like HugeTLB) arch helpers. Now in this case, the = MM objects > being emulated for the HugeTLB advanced tests does not seem to be suffi= cient for > ppc64 but it can be improved. But that does not mean it is broken in it= 's current > form for other platforms. >=20 There is nothing ppc64 specific here. It is just that we have=20 CONFIG_DEBUG_VM based checks for different possibly wrong usages of=20 these functions. This was done because we have different page sizes, two=20 different translations to support and we want to avoid any wrong usage.=20 IMHO expecting hugetlb page table helpers to work with a non hugetlb VMA=20 and without holding hugeTLB pte lock is a clear violation of hugetlb=20 interface. -aneesh