From patchwork Sat Jul 10 11:29:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Qiang" X-Patchwork-Id: 12368551 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 BDDEEC07E95 for ; Sat, 10 Jul 2021 11:44:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 549C7613C2 for ; Sat, 10 Jul 2021 11:44:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 549C7613C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=windriver.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0C3856B0073; Sat, 10 Jul 2021 07:44:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04C9F6B0078; Sat, 10 Jul 2021 07:44:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D92C36B007B; Sat, 10 Jul 2021 07:44:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id A5A576B0073 for ; Sat, 10 Jul 2021 07:44:09 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BF1C82C6AF for ; Sat, 10 Jul 2021 11:44:08 +0000 (UTC) X-FDA: 78346494576.16.4913458 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by imf11.hostedemail.com (Postfix) with ESMTP id 4F01FF0000B5 for ; Sat, 10 Jul 2021 11:44:07 +0000 (UTC) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16ABi6du027799; Sat, 10 Jul 2021 04:44:06 -0700 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by mx0a-0064b401.pphosted.com with ESMTP id 39pjap8vca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Jul 2021 04:44:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8NnnuF2nQ8w8d1L8ORsGeJJNUT6HxirwWbcPvhe+PrqdnwsJBdDa23JGlT7PYu5HJPXrHT/lGq+YsNQPEHyQQhGmUCJIETjpCvEenvw5K8S/tXmVzsgp1wuqWdzt5YGxIf8saRjdiVJaIXE1uJ/3B8iqid2MrZ+D6VoA2LxXgrazqXRnfHwJVlv0rQQOLjiIYM60aMc9CCdGAgDpDlUpU4uEx/gcAigY+uxm8QL31I8+MMoqc/Vl6DYx6Krr5QrOEqal+Gz7Do6A/hqAudgUJiZIT7QQY/+b7GAFZ/L1qfLSdHGQay5ZtuCFamzt90LWSxyKjBdr48eRs0fu8JAPw== 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-SenderADCheck; bh=Ip9OamNf2I5rNCs1zmnoO+EZRvLc2uQZ8dvrN3k7kG8=; b=Mdf9g/WZbnnTIkU7rQiAiuD8E8/rFBY6e0TfA1+/kIut4m73yF+XiF+LVQ79m8kIUgTfb6O8Ao9eTqW4xocCb6gFlCrH3En6QfFpiAc+zDX/18NyjTFx/Sjp4NZiIPmvK3n/yhUn2EfNORyxsnD00xsOWArGaYNJJtYH+6HwAXoOLDgXCpPiAjoPipJPXwyZcnq8LkdU0Y9qRBY5kPJ/9oulpdJqlikxvK58xrPCtE85wJpnXhq9dVkGKvcoTuo5tyaeYcfuo0snJXQA9EjDqsRDJKX8+Bj/xDHmZCTZAf6d/aKWLIa4QqM5dTZHdaRmvNHx0A+WYbaTPhfRUG9g4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriversystems.onmicrosoft.com; s=selector2-windriversystems-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ip9OamNf2I5rNCs1zmnoO+EZRvLc2uQZ8dvrN3k7kG8=; b=XHMZmMbLfrR3v220sr+OArVmlcpI4ra866Uf+D6rPt067RIWQC2Z2VpsC4mi/ASNwbrfDxK1Uz25pfHzQvkl6plvUP2lkr90gqXKxyqHXdpbEECnW1lwQGhYcrytLUMzg3AkLB8mRmxQwi3D9TtCqcOLzoK2+LEPMRJizDi/Swg= Received: from BL1PR11MB5478.namprd11.prod.outlook.com (2603:10b6:208:31d::12) by BL1PR11MB5221.namprd11.prod.outlook.com (2603:10b6:208:310::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Sat, 10 Jul 2021 11:29:55 +0000 Received: from BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::a140:b563:8725:5c2b]) by BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::a140:b563:8725:5c2b%8]) with mapi id 15.20.4308.026; Sat, 10 Jul 2021 11:29:55 +0000 From: qiang.zhang@windriver.com To: mgorman@techsingularity.net, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/page_alloc: avoid hard lockups in __alloc_pages_bulk() Date: Sat, 10 Jul 2021 19:29:29 +0800 Message-Id: <20210710112929.232268-1-qiang.zhang@windriver.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: HK2PR02CA0213.apcprd02.prod.outlook.com (2603:1096:201:20::25) To BL1PR11MB5478.namprd11.prod.outlook.com (2603:10b6:208:31d::12) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (240e:305:7883:21a9:70b4:3c74:7e20:15a1) by HK2PR02CA0213.apcprd02.prod.outlook.com (2603:1096:201:20::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21 via Frontend Transport; Sat, 10 Jul 2021 11:29:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 471930a8-e821-4f99-7fae-08d943960a8e X-MS-TrafficTypeDiagnostic: BL1PR11MB5221: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3044; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yt1MI/E6acD+6revFCaSw6/3LeA6SstvvpquItVATbFdCcTpfvAJsVVp/ayaRjU0v4OViucECNkZOlMqPViVY5dNCidj7wX0Dl0ZfKbGqUBU+RAB7PqW8LWlru3q/nTy+GxA8oDMgVimg3yO9xoYxzE5Wwz5ZVR1GK4Lua+b7hSfUkgsGitcEuWGFEUpst3VmdJBxWwF3qnq3NriWK8sNfG43lj9h655m+dshxaq4op8RQDwwWVIMQJvouaa4FCOPNzDqXSex0OpFqNDTSlYqUbQPTAvEkYgM32ql2kZjTFTlL2gaxTyHDCFWyuKYwWBhktus/sajKez5ZhFCH7qJWiZR6/Fqv7sLn8MmIkBa9rOQs4xrUs75+5izC4GjRhVp2n8GMDRfz9fzY0NzcN/W5djiFX8gSnzj0/C9sLcIZ2bvdP9lVlKmc3h2mSBKpv5dH/kXVZV+yd2jtOVArxjCc5Ftxl7Pv6n/b+shi9Mcgwt4dNeyjZnlYK4KI8FSWlYG0oqgdIHZTkimw6YLazLd//N2H6/q69rk4/dYB1f3wSHLORusR2f6wRMOY5T4E8lrJ55Z6bfkWTpdYcwQfxBtWElYV8Ljg2I16H09fW1yogCs6xigzZ8CZwNqxs76MDp63Od6JuNnr72sQcSl/hD5w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR11MB5478.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(396003)(366004)(136003)(346002)(39850400004)(6512007)(9686003)(6506007)(52116002)(6666004)(1076003)(66946007)(66556008)(66476007)(2906002)(6486002)(38100700002)(83380400001)(316002)(36756003)(478600001)(86362001)(186003)(8676002)(4326008)(5660300002)(4744005)(2616005)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8LXMo01bXzeH3iyLU4BOL20cw7xxKVN2duGnNEK4h6CabWFw1Lr8f5FBwH47dtc70NCvPPA6ihLscAZeMbPjdJ+XckGqiSG0usvmuL2osfM5evwyN6RGNwCVvegLvUpSXhQz4QTVHJI/FLdiz5eARLfStgX++UsLVNfID0E2HgUPcj9cYEk16uXkH9zh70Q2wWsUq7WI6+JZyKeD300nD0qrmTv7RyvMZZCvazUKkheIS58e+FJrTjRqqUi424P5HQJ4zf8/PKxr71Fkx9YHbTtvugVYmBM4xnZPstznuKdfVyP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ozMtQ5BygI2owOHCd+fHDOwLC1AqYO X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 471930a8-e821-4f99-7fae-08d943960a8e X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5478.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2021 11:29:55.4795 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hKMnCEsvKi4LRIEnIv97oAH68+prrNHvYa8Doua6CrDdbgm5yd6uwqAV0XJGIiOCM+EpXOQoapSyTQADmUJYdLPYwM4CoO2oYIMWP/BEAxo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5221 X-Proofpoint-GUID: fGDd5NQiv-0PfPVjDrRjqWw98dgDvepw X-Proofpoint-ORIG-GUID: fGDd5NQiv-0PfPVjDrRjqWw98dgDvepw X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-10_02:2021-07-09,2021-07-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 suspectscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 mlxlogscore=825 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107100024 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=windriversystems.onmicrosoft.com header.s=selector2-windriversystems-onmicrosoft-com header.b=XHMZmMbL; spf=pass (imf11.hostedemail.com: domain of "prvs=282540f855=qiang.zhang@windriver.com" designates 205.220.166.238 as permitted sender) smtp.mailfrom="prvs=282540f855=qiang.zhang@windriver.com"; dmarc=pass (policy=none) header.from=windriver.com X-Stat-Signature: 8yuurq8cn13fd7g8s4pk3ycq6aj9fz6a X-Rspamd-Queue-Id: 4F01FF0000B5 X-Rspamd-Server: rspam01 X-HE-Tag: 1625917447-612088 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: From: Zqiang The __alloc_pages_bulk() mainly used for batch allocation of order-0 pages, in the case of holding pagesets.lock, if too many pages are required, maybe trigger hard lockup watchdog. Signed-off-by: Zqiang --- mm/page_alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d6e94cc8066c..1127db25507f 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5315,6 +5315,8 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, else page_array[nr_populated] = page; nr_populated++; + + touch_nmi_watchdog(); } local_unlock_irqrestore(&pagesets.lock, flags);