From patchwork Fri Nov 4 01:16:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 15267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp100861wru; Thu, 3 Nov 2022 18:28:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6AMVjSq7bOnPJlz0VupXTdG3DiZIaDHnKzvRKE1g3GkaJM+lDjWUUub3BBE2XmxxrVdF00 X-Received: by 2002:a05:6402:518a:b0:464:5ec3:c5a with SMTP id q10-20020a056402518a00b004645ec30c5amr1885458edd.90.1667525319805; Thu, 03 Nov 2022 18:28:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667525319; cv=pass; d=google.com; s=arc-20160816; b=NDZmdeEasG0nHP7PdUG/LkWxy4HsBvB7g4N65vbKrJ+3Uy3w3xE5xzNpBr2bLBwBNv RbtJq7hTyRVFjAAY3og3hMQ888su+tQECz3cgWSpGaGrBmZdoa2Lez7lkICgizbhD3/L QrfdltrVVhTO4bcbKUaUTIDolxmTy54WyEvNGX1RZm/SBNYoW7M6g351oMdeVr/w0OhQ ibVrRph4KKJr4ve/DpjUiJkex5rzbnD5r4XduPBi36AhPGke9rzj364ulSHIPbtRFotY RNpLjIT3ZgMh/popqhsCl81vyFcLc/G0EroRIpzzSMQyAjs3W7ZqfZN2wqWcxYN1riTE 9L0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=afDnWx7KDSr+HSL4S8p4GAQRhSMVUXfqMhYDI8im7Bk=; b=Z9V7ff2xV05c4FGDSOk9xIUuiMYHn4pG1VpC7puhHR7kY5lrbqeTgxEF/+EZVu/6Ll yzpTBguFT1EKM9GopBs78ifk4N5ZKfDsnRrgSIKlajXkT1LRdeQJkDlm2CCRHXZu6jva LIKzUQzMTapa10ukgeYxLdAe/6g6k63DHZLT3p00C7kOJBVw6gZiAFEs6yH4kWfYjR6Y XgXl8qYDqM+aR0gJHzSVa0kxqRAvZMIeAEDYD6v2wZiM20dAQbknvAztTia566uAwRCL v84HAvwtF3UhAquD45Sekzal2cqqqcwXp6UpSNhlrlO8PwkPkTPHGIMKiJXRAy4HCXWd uDww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Rz7U2RL0; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="K+97/8ex"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a056402054600b0045878eab247si50602edx.193.2022.11.03.18.28.16; Thu, 03 Nov 2022 18:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=Rz7U2RL0; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="K+97/8ex"; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiKDBSx (ORCPT + 99 others); Thu, 3 Nov 2022 21:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiKDBSv (ORCPT ); Thu, 3 Nov 2022 21:18:51 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 025F4764B for ; Thu, 3 Nov 2022 18:18:50 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A40T8tZ017515; Fri, 4 Nov 2022 01:16:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=afDnWx7KDSr+HSL4S8p4GAQRhSMVUXfqMhYDI8im7Bk=; b=Rz7U2RL0TS7JXynFcNYvcXMZNmnmQVwQroyoOH6WtzPXAZQzy7RUuhaQtVoWY6ZsSal4 fBnfFMWuvJY9Gq0j3SDJBCeeWSYpjfqPNl/lk7VBdnS2gw+9MYEBAMqjsuRMyd4xd/qT e1l21JlF+6SUi7mBJx+z9yK2Ta8oF8m/EEEQ9+36CDEzXXo0psFFuUb5ecMXSYVkBPOZ 5DRgADzMfTtLkwhjnMJgAb4KlJBJ6TRzuEkkmwYeXvUyHWkCY0OOPG/o1xxz14dwugrx VgNz12j7S8hAr9SvkYcLu4Ng1xA4MB7DEhgUS2nHLaSMCavNvtkqiYLVM/W+Jx/ekmyr qA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kgvqtpsxa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Nov 2022 01:16:41 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2A3NL3O1032943; Fri, 4 Nov 2022 01:16:39 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kmq85hwsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 04 Nov 2022 01:16:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DBSnp+lMbzySjSwMJj5FL/ozOYjnTA0kltrIw9a8THXC0+Gh0mdgKoxVeelV6eM2A6sxToOdcxiiLc0r9Boeg6G5R+RQ8yL6TptY/j0AQE/Rc/mxBTYMdQqhUhvNFePLy7nDMkOUFjAse2OrkfrpVI5v5BiOHAHSGQOVNR9KKEwp4DSr9iSASgwhv5lQL398KBc+j8UO8+hOSTIcsGdyg4i+K4Tqdum1lT/uUnmmKN1fXNdPkLft+O/Wyv8VTI1TF6q/4LpHInbdBOin8jjG7EQoy7ENbs6GZHSPdPYMgO/x/hfKlo/zI+n8k3Q8rpT3kQ6G6vlLkJZVwxIn9I8lFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=afDnWx7KDSr+HSL4S8p4GAQRhSMVUXfqMhYDI8im7Bk=; b=F1agSBKeDtQ+8j644BER6KrRp5PgrE/KEeLIKqBuZmq+v5zoSuAT4WVU8y4nuURc/kQq9OUDd6k8JB6seuwTrlb7orZ0RFrL3qqWViQ8HsfS44AB+qRaQFXIE+fU5fQOgbCIdpziSJmgLl60zgPAawBRr1GNUq66eWMFK7YKQmCXJY9X3Y7TXISlvKwUUyhSr+PAsVSBMymLV0H+f76MBdm74Ck1cV2s9rJe+TQqMWke0lRm6Z2mzL1tWyc7voIscpnSE3qw2W+YIgh5LXEm5QR+tKJGP+fU6sIX+0AGrQ7eVph5ndnKrZ7dz/dSzTIMD2KjHi/mSoSAcUOUiJST2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=afDnWx7KDSr+HSL4S8p4GAQRhSMVUXfqMhYDI8im7Bk=; b=K+97/8exGKqyisYIeLWqwOdNX05zh8AWo9qcfmdDVNGt7dLAmpZbdiYIwiM2P6aWGvPXiMskr14bISNYJmAltBCqxTg4E+JDV1wcysVH7ZamsKqiqHtSMhV2DAwcVRByHSTATF+4sH+kie+yy+bpBHfh6/o2BGbf59vsk8ZUIfw= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by CH2PR10MB4151.namprd10.prod.outlook.com (2603:10b6:610:aa::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Fri, 4 Nov 2022 01:16:37 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::58e9:95ba:d31e:ddd3]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::58e9:95ba:d31e:ddd3%5]) with mapi id 15.20.5791.021; Fri, 4 Nov 2022 01:16:37 +0000 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, oe-lkp@lists.linux.dev, lkp@intel.com Cc: Rik van Riel , David Hildenbrand , Andrew Morton , Mike Kravetz , kernel test robot Subject: [PATCH] selftests/vm: update hugetlb madvise Date: Thu, 3 Nov 2022 18:16:32 -0700 Message-Id: <20221104011632.357049-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.37.3 X-ClientProxiedBy: MW4P220CA0006.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::11) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|CH2PR10MB4151:EE_ X-MS-Office365-Filtering-Correlation-Id: fcdfb4c9-1c1b-40cc-f456-08dabe023866 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uHJ3dpnS6tcw5tZiYnbrhVLmnqee8QyIjN0IKFqiP7Mn0gCvMMANwSjxyhXxoYTO4hO0bzGY1GiGIeKQsP1EKdOXx67dGb4XcinStHP5P/qEfcbqmZA3/KVPhQzJPFvKCzUx93Kp/BuksL2Z/uZT85dvSev3ZSa1omdjaV9Kr1iDx5WJq7jo2wzIlAWhvbltzjr0mUXZN1c5c7SM2773A5V2nLpiQ+hCh/nrW9MJFfiIKYD7RkXUj+pzsnz+KyGk/h+5PcoyFUBc1hJUYV3krj2jkr2YWl747XMJcCdtrvP6S/QWUCX5Im6J2cBqSTHemZeh+7VbZeQF2DGXkLscqZXFeCt46mTyO4wEp8bmD+dF9gkSBMLm5hdhyidfZ0aflLqgNw3uPAv+hVnA5lg9qD6X+aXq5T+VAu6sZ7rloJS7nOPvccdrwO0aADwSLhUTVug8wRgSLmPT3w8QAqtY09nsnTs9Yl5DRmgvXZB9jq69ZyYM2IlTRJMksZsWiauZZhubenpWsJ5/SlpopyC/tZHcu7xx2HuBL16qqx3oAqx4RjDV3a5Xir2JDOZduw3oRpHf7Z8d2YuGi41e7CXxAgo7nBTtuNvUVajhDAcTfjtSnnhWb9zpW/JD9ss3rYk0R3jylEc8I/Oh1zy0ElBlZJWuPwo2uv75iRtNTayGRs2dXB6VHMrlcUg61RhhdXCQ82nZhaIhhstM2qQ8risrUUS05M4ptA85g86fazXeFoM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(366004)(136003)(39860400002)(346002)(376002)(451199015)(2906002)(15650500001)(44832011)(36756003)(316002)(6486002)(966005)(66946007)(83380400001)(41300700001)(4326008)(54906003)(8676002)(66556008)(66476007)(5660300002)(8936002)(478600001)(6512007)(26005)(1076003)(186003)(2616005)(38100700002)(6666004)(6506007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NKMCnK3WBf82+pLxXicH0ET2TJ/mN3TxGA+OncKjQQi6SyNXVF5Ii4QlD9j9wpNxaZmWWqUafdCzvNt7Hs/7zEplL7D5CPmUxxNovYxk/iqx4BHhAx7ZfVQooG571kprS9IFKmbyit6AKYHYvsOVBkItDn87ynENDxAv6oFcEJvcTMVGpiMO25GEZ/CbWjOLdGiVAuJ5G7qHhxnvV5w0C9g83J010MOUgoJOlOdGL0CwIKtG/MUKS8+a4CyFF4dj6/4jhTw4cwKuCLrBdVM+kdPnJe3yFACJcns3/9TOTJsYZgjvgzDz4NIYbvZkJukBXedjPTnI7w9gZB2oo/RW1Abnh2Mgn3iWa4pdnL2XhJwzF0ysx9StWGv+iP6Yz9aRwakGv5ABS0EdL62l577vc0QgFP3HSwIMOg3sgKbLrkLI8NhveAX6UuRSD2uLGNPEpgz9fV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Uc9SnbadjMMtfmPltS7VqurGTS572GjMoz4zDAsUVTjd1MWGep/jTGL3cn/cME8VCYt7jX7yCXZ6kQwy+jtKgX/fg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcdfb4c9-1c1b-40cc-f456-08dabe023866 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 01:16:37.3704 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DglfjAGe6oB5TcFeeZv6S590/l+LdVwrkaDP0r1NV+lz/3jcea7pYmMlzY67bKl/wlWanbarcfq/bgF56YZlIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4151 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-04_01,2022-11-03_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211040007 X-Proofpoint-GUID: u07FZF5WFJWHk4_BU4H2p86JmJ1W3c2K X-Proofpoint-ORIG-GUID: u07FZF5WFJWHk4_BU4H2p86JmJ1W3c2K X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748527030095704706?= X-GMAIL-MSGID: =?utf-8?q?1748527030095704706?= Commit 8ebe0a5eaaeb ("mm,madvise,hugetlb: fix unexpected data loss with MADV_DONTNEED on hugetlbfs") changed how the passed length was interpreted for hugetlb mappings. It was changed from align up to align down. The hugetlb-madvise test explicitly tests this behavior. Change test to expect new behavior. Reported-by: kernel test robot Link: https://lore.kernel.org/oe-lkp/202211040619.2ec447d7-oliver.sang@intel.com Signed-off-by: Mike Kravetz --- tools/testing/selftests/vm/hugetlb-madvise.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/vm/hugetlb-madvise.c b/tools/testing/selftests/vm/hugetlb-madvise.c index f96435b70986..a634f47d1e56 100644 --- a/tools/testing/selftests/vm/hugetlb-madvise.c +++ b/tools/testing/selftests/vm/hugetlb-madvise.c @@ -195,7 +195,7 @@ int main(int argc, char **argv) exit(1); } - /* addr + length should be aligned up to huge page size */ + /* addr + length should be aligned down to huge page size */ if (madvise(addr, ((NR_HUGE_PAGES - 1) * huge_page_size) + base_page_size, MADV_DONTNEED)) { @@ -203,10 +203,11 @@ int main(int argc, char **argv) exit(1); } - /* should free all pages in mapping */ - validate_free_pages(free_hugepages); + /* should free all but last page in mapping */ + validate_free_pages(free_hugepages - 1); (void)munmap(addr, NR_HUGE_PAGES * huge_page_size); + validate_free_pages(free_hugepages); /* * Test MADV_DONTNEED on anonymous private mapping