Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2094095ybi; Sun, 16 Jun 2019 21:38:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqEcHxcTqcByXfkrkPeN8rkvIrzqMz5ZgRiE6PDNiXlMSkBsdw/qPfw6ZWg9fyTVRvrHLD X-Received: by 2002:a65:5308:: with SMTP id m8mr21828115pgq.54.1560746328103; Sun, 16 Jun 2019 21:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560746328; cv=none; d=google.com; s=arc-20160816; b=PdZPhqzqG38LLeiqQGnvTfaIgx0Gc0vqni1hhC8QYRUbswx8wtw294qZmo2K0H7XAy 8Smxv9eNS+Yg++3R8oJXs5/8IEbzGoZq0oMT9O+/1afLU+K1uDjX3hPm97zGkBMLLWHU CW8ZjNmtQ77jtpsxlVarNzYB0cry2ivHJw68SUfr7C7aqCRJHZ3KgL9It7fq9UUPGixl lGdj9vUj5SDDV6qF2p/p1QXvmH8u21+lErRNG1x6jJDIcYZ56O2HS0gQX6+uelHFNaqb A6UB3MP+WwmAUxojUE9jmAnhQbqqmXSNsuYVviw3xNOVQ8TMjCfGD8wB95VdlvwnpgS3 P0NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=qupq6HJVpW6yR0/6vTvyHcMi1an+ZHHeFa9yUcwW2zQ=; b=ySdlF+Hnh/JX00W8jf8V08N4zPLpTBFO2+NkrrPCM3VjVXdezMNJaxH0mWk5yzbAXF 9+RwGtvsvSZ00uwMCDT7xhn/+jTH5XQVRaxpVp25vBcuLdrBYm6udlEzLI9dPx+KJ0lc DvjYUKPOZ/6akD/SRr5RN641Y2+S4yklFnxNPEBsO3tLygUkGk/CTID0139vDCayBYyO OI/5h1XpokDenF2r/3k7aT6Cm0sEu2m1lr6dms+ysxI4b+6ZHCrf8MyrvQop9M5+3jUS 8pthPDBik2U44vi9QScUhzjEKCnPqUSB/m/7EnMT1kSieLBHGM4RQQkU+kJVPt0MDyx5 V7KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si9274981pjo.26.2019.06.16.21.38.33; Sun, 16 Jun 2019 21:38:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726177AbfFQEiV (ORCPT + 99 others); Mon, 17 Jun 2019 00:38:21 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:33900 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725823AbfFQEiU (ORCPT ); Mon, 17 Jun 2019 00:38:20 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5H4bsY6066827 for ; Mon, 17 Jun 2019 00:38:19 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2t634b1j6u-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Jun 2019 00:38:19 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Jun 2019 05:38:17 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 17 Jun 2019 05:38:11 +0100 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 x5H4cA9P37945852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jun 2019 04:38:10 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C5354C044; Mon, 17 Jun 2019 04:38:10 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 18F1D4C05A; Mon, 17 Jun 2019 04:38:10 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 17 Jun 2019 04:38:10 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 071D1A0208; Mon, 17 Jun 2019 14:38:09 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: Andrew Morton , David Hildenbrand , Oscar Salvador , Michal Hocko , Pavel Tatashin , Wei Yang , Juergen Gross , Qian Cai , Thomas Gleixner , Ingo Molnar , Josh Poimboeuf , Jiri Kosina , Peter Zijlstra , Mukesh Ojha , Arun KS , Mike Rapoport , Baoquan He , Logan Gunthorpe , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] mm/hotplug: Avoid RCU stalls when removing large amounts of memory Date: Mon, 17 Jun 2019 14:36:30 +1000 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190617043635.13201-1-alastair@au1.ibm.com> References: <20190617043635.13201-1-alastair@au1.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19061704-4275-0000-0000-00000342E41C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061704-4276-0000-0000-000038530560 Message-Id: <20190617043635.13201-5-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-17_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=932 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906170042 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva When removing sufficiently large amounts of memory, we trigger RCU stall detection. By periodically calling cond_resched(), we avoid bogus stall warnings. Signed-off-by: Alastair D'Silva --- mm/memory_hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index e096c987d261..382b3a0c9333 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -578,6 +578,9 @@ void __remove_pages(struct zone *zone, unsigned long phys_start_pfn, __remove_section(zone, __pfn_to_section(pfn), map_offset, altmap); map_offset = 0; + + if (!(i & 0x0FFF)) + cond_resched(); } set_zone_contiguous(zone); -- 2.21.0