From patchwork Tue Oct 26 22:06:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 12585779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06E31C433F5 for ; Tue, 26 Oct 2021 22:07:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7B056610A2 for ; Tue, 26 Oct 2021 22:06:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7B056610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1344B940008; Tue, 26 Oct 2021 18:06:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E332940007; Tue, 26 Oct 2021 18:06:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E77F9940008; Tue, 26 Oct 2021 18:06:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id D7B91940007 for ; Tue, 26 Oct 2021 18:06:58 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 96F2830C67 for ; Tue, 26 Oct 2021 22:06:58 +0000 (UTC) X-FDA: 78739974516.32.617587B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 407D49000380 for ; Tue, 26 Oct 2021 22:06:50 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19QL5CxL007140; Tue, 26 Oct 2021 22:06:54 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-2021-07-09; bh=wpJaVM73rY/OMeAOivsT+xjIS5v+jJbjnF5fVTXiYew=; b=YADW7jG/t9CLFEQlJBxwmYKgjy8nE2JWefDYLklDAmBe/v8hgsHzZ0QX6vRhM30EoBDn +qu3LA2rDF4OfTliCcKRT7Mr1dgL6L6sIUnI97c7Vb/p+mXXniL/5ED0B/+cVAK7b5Sg wXk+MKUxTn7wj7E6km/gmX/+rZvJWz9uUuZnuc/GN+u/oHEuTc0EXolcBcb/dztddult 2I+6F4flsoVzWGZ7lJ4J2DFd9m5xMSkGM4GVGGhZrrOFqWAQ7Is0AKIIttfC6AJ/BGvY smRH8S7GYHUcAKu+tTH752qSGVF9KyCjv1Xnoj5i6cKHVr22YPKB+R6AUve1oJhBC0Jv SQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3bx4fhyhwm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Oct 2021 22:06:54 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19QM1wka015492; Tue, 26 Oct 2021 22:06:53 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by userp3030.oracle.com with ESMTP id 3bx4h1ce2a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Oct 2021 22:06:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8C+Gv1INAOuLpEhWqvkACCId95DpDtKf8HFc5TbkSx88a31rBfangUVUDwNmo4mdjQOGertP1O6KeadZoDXOJ8ZPwe2Iz6p3D3D5do66hIzSdS7cDBVroTliJZ4V+G9pVBIbImqTzVEdDzcXIa0Pj+eZ2G4pCXNxf/ac004bqROmTIT4ClFNtNS3Gl6f11vLZQwTfIYYvyJUE15agAiJMErn5/mhiFMpTrYfGm2uAfhzx7ld//xw+H5030zptYyCrqEUrNpsuF01w5+K46hA0vH1s8pUd0qMq73ICuvy2IxaFdUjq/QxvCWm3oUIuyrrP9quyddxj9NDpAfEju3uw== 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=wpJaVM73rY/OMeAOivsT+xjIS5v+jJbjnF5fVTXiYew=; b=lh7G9yc3Ng+WgNQ46PQEMMeloL9MzRisT3ktG2elsbGc9ctjCVtxmnFwWQEvHViQZLRbfEBY7jZarOciOfxbaZyJiJm6Ga4RoxZopdc8qu+c/eUek4C/83hlUAbdq0KEP8gBZYoqveO0iZME4qH0DtehdZV3QzPDSdLPT015IBU1e+9FkV04LR1bHvJShX2a6rVUHYv6IneTmrpnhTUlbrpZcgEh3LLKjevpKcMi0iasLHreaxeg1tFWFJTr2sF2cIg/e6h7g6ju+Ou8Adb/sPEB/4IuE899Ah709C/BaD5fttTp/3MN1UtczQNzweOoQhcWKY6F0Q+5/dyK07MAuQ== 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=wpJaVM73rY/OMeAOivsT+xjIS5v+jJbjnF5fVTXiYew=; b=xqRj9yJaIA7oT9SmdJuI0Zod9RKDNjlf4ZuFVM2FUN5sLYv1EbidVJATjkrNgMbTNevFdnE+DsNR2kGSQ/8nylWIe38yDKN8w9CRJWAolMK41rRVsEOa4gXQYPlOhVzt1azR9LsIK9SGEbNzF2ksBom4Qqn6C4S24/efOHRRaeA= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by BYAPR10MB2614.namprd10.prod.outlook.com (2603:10b6:a02:b0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Tue, 26 Oct 2021 22:06:51 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::bc59:71de:1590:cbf5]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::bc59:71de:1590:cbf5%8]) with mapi id 15.20.4608.025; Tue, 26 Oct 2021 22:06:51 +0000 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Muchun Song , Andrew Morton , Mike Kravetz , Pasha Tatashin Subject: [PATCH] hugetlb: remove unnecessary set_page_count in prep_compound_gigantic_page Date: Tue, 26 Oct 2021 15:06:35 -0700 Message-Id: <20211026220635.35187-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: MW4PR04CA0200.namprd04.prod.outlook.com (2603:10b6:303:86::25) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 Received: from monkey.oracle.com (50.38.35.18) by MW4PR04CA0200.namprd04.prod.outlook.com (2603:10b6:303:86::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Tue, 26 Oct 2021 22:06:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95d8d82f-4403-49fd-6066-08d998cce975 X-MS-TrafficTypeDiagnostic: BYAPR10MB2614: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:366; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WDjvaWkL6Fu3H/hJw1v3cD3kJNWlmDFRuD86Xg6YbuKteybEY6xIT3O0X+ER8B1L6cEavcVSv2uAsFTEF4UsWAL2RysaZr9ViQOiQLmCqdtqZvsrPYq0UupOk+S95Q+3ofH+JCaY5gsKhNyEs3FSYb8p5MlmUDMqbwSC79o2l658jbr1cY5E/K+Nb9gbHTDAcaSZ40wIHmv137Yb30N0t7C+aSou8wZ0xcL0239ZNGF2Aam4a9bfiuT5W0K+DJW+Ts9t4KjuPrG6hIaiAN14Dkxp1sNN/5leCtTm9y+1OzjPqKuPVuM30EXbwIuJ4rGCiXIU5/bHm5XXRfhXfS03oQz4mg6p/dJvOPvbpJrXut3oxpYmfHgVRKMkIVRs0e1RPCJHdA5deQQ2ygdqWgXJw8gNJqekljowhGM+yz3xRApCvjGU8ERY5fzeUf5X92MLHJiYsw5MbQBAmi+foKg3/9GK3hnAlnX+7AJXIr/q5tm9VGl2SJGv43WBZWJeb4ee88yAD+r1NBIs4aO+F7+uz7Z/9vOfjOPTCxYO7dwBp8607yrCdUR5DCH1HtFYWQI6th7xjqltcEd07sCsyIOZEJrXWYX1xS6CL5NuWH+dzQhw1hFEF563j/qBFEZ/KqDxcMtSynnr/YsrvguUzAUGUJSQ2VISJNrzg8bXdY1+bLIevXFLOZpz/+LqigGoviMx4LiMDEC2NzrzgJsEbMrvRQ== 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:(366004)(66946007)(66556008)(54906003)(66476007)(316002)(186003)(2616005)(26005)(956004)(36756003)(44832011)(38100700002)(38350700002)(6666004)(86362001)(4744005)(52116002)(83380400001)(8936002)(4326008)(1076003)(2906002)(6486002)(8676002)(7696005)(508600001)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NUbMs2xwtUyWrZv9aBfN/NORurXXFLDxDDl27HDMYEVm2L4+sXi5y1t7brvL4MpLeFfDOLZMO784Rhj1PHiKcU4jvmbSXGGr6vIXX95+ldeMHSwbEuPffH3fs9lmBDZwNNcoTCB0u3+pOpRPoVNtgLmx6O2rQihdOM9HBRcUFZBcLkS6dfoiDHlpckGNAWHDLA9DOBsZt0EV7PFhVa1xtSKM8IqUNAPw19vTmxC3pkuYCOauUVUxM8G4LlICtmB2VvWY4pZyRTJayvVwzoCvIr7ZsUZq3TPk/L0ChOsRemTqQa8UhXdtOJnR+H0SyDqvdV7XSgEukbM/68ijkbZ/taj4uup2pz+sNMy1phtj8eebLTNgw38dAiIieTKw9yxyRp+DpTYDynNReJcgUyTwsEsjJeXYiXF/SgbKfADYFp9rz9FWwygrLmA1utEPRyruTmReoX5R/gl6hhejWq8Uam6sk73sMFzpUHEb5t2RRRZCCr1tvcMrMm2e7vCoYPS4N2P6DkZb/DV3ugKraq8qVdHR6n8CmoXa68wUuP4eNaFXFpnHFp0dMPIlB96lm/KTwDkqlT1KbmFzBg2eJCLvePKJyoO8nqpqxhZajJrHaB2zewDC7LIyqeucA0HYwqJmRF9/yNv+PyO/uvIKHPqro8LMHfZCVTi6gVM1haZ83gswLrhx784/RmoMZ4F7zOU2NIkZsVNNQ9PgsAN9wcqg2xpRuyfotck4YNc+JZoums37kNAUdl6DbogBZv+8dS6fGRibLR1jq5gu/btH0iT93pBdN63v7tAPSujsPeE95SrzUBko+OaLBtW9VrKuNuZ41gMX0Nhpo4U/unBxhjTNr/80QYK/Ezl03OERvCCL5jBSs2BEw/KCPGeX5B06SbOw0R5QvLT9fiDMwMOlhPA2DdlQzWfQjvR2TQwhZWBGgaWrJKdiBd17xPloUPzv/tXBImMKkg8GvMr8KteZyE3B4cY6Dbrk56BtZwWAeVZgdMElGqqBT0PvUPl7eqcQ9sCw3v1gBF901ZHKmYhQ6a7qGsMFJJhY/p8q3SDRooR1PHdlgtzN2rMwwjxsgBNA15uZKV563Ge4pYagF2Y1huIHtPKKKgK4fGaRb1gV3crQWu5731eKi/dw/82BXBaxx8dPjl7J6l8DyFf1qkhhCwKqjuXP8nxynshTxYJYg/OUQmN337h9bwdJ1YfvJ/dmfzxNIgMgeIdwpRuSgZvyVGdPivt6ckaZ57YtUjxPDcLfHdYih8c++/a9Hhk5fFm2Rk64XnSv/onrG9de0L7Li6jccV7SmeQxM06yYLBnYJ6xaU9P9hkTYIOYk7Afu7I8DFa7H7cEczAs0fVwxpO/u0hq9TiEtaCzehuJk8KauYFoSA8zoz+JbybYVqsDCFqiJg8tNZUGTzCvdtZ/BubWvoxH+VdURYhZQlu+on/P9Ptl4HJ8fywvvwWLluWemUX4MLNruadLwlybArni7uZNXvMxU1qUThXDt9op+ByjGz+L8sDCvOa7NsKWqhzCZcQH3NECmgNrb5OBvAnh6Nj6rXukRl037h98fmEk63K/BzKheP2Eef4L0TqpBf80urEdWhfPbhOEcoI8ce3RBGVlR/s+FuaMGeoeAXjjXwMKB/eCxHE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95d8d82f-4403-49fd-6066-08d998cce975 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2021 22:06:50.9370 (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: Oo7NO9gVRo0nHgRAJD5x8e6B9zTwS6Opnm2eogoh3usI6qui03shoZAfjGAVM8wDQwwMf45fCUMzdBf/sYpc9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB2614 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10149 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2110260120 X-Proofpoint-GUID: H-6fUObRQT237FW62UftXAz4tetqxZ63 X-Proofpoint-ORIG-GUID: H-6fUObRQT237FW62UftXAz4tetqxZ63 X-Stat-Signature: 8rpofiu63frogw36huq8qyy11ndup48e X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 407D49000380 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b="YADW7jG/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xqRj9yJa; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf23.hostedemail.com: domain of mike.kravetz@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=mike.kravetz@oracle.com X-HE-Tag: 1635286010-110646 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: In commit 7118fc2906e29 ("hugetlb: address ref count racing in prep_compound_gigantic_page"), page_ref_freeze is used to atomically zero the ref count of tail pages iff they are 1. The unconditional call to set_page_count(0) was left in the code. This call is after page_ref_freeze so it is really a noop. Remove redundant and unnecessary set_page_count call. Fixes: 7118fc2906e29 ("hugetlb: address ref count racing in prep_compound_gigantic_page") Suggested-by: Pasha Tatashin Signed-off-by: Mike Kravetz Reviewed-by: Pasha Tatashin Reviewed-by: Matthew Wilcox (Oracle) Reviewed-by: Oscar Salvador Reviewed-by: Muchun Song --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 906fe8a3b93d..88047a367080 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1795,7 +1795,6 @@ static bool __prep_compound_gigantic_page(struct page *page, unsigned int order, } else { VM_BUG_ON_PAGE(page_count(p), p); } - set_page_count(p, 0); set_compound_head(p, page); } atomic_set(compound_mapcount_ptr(page), -1);