From nobody Sat May 4 21:26:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1611830152; cv=none; d=zohomail.com; s=zohoarc; b=Hx2+V1v6XEXtwkUWsxbb7m+iiyoUbOI+Wlegtgv41K2d1QzF0kqGEW4Il5UZewWEbPZ2KA4D76VZ85ongrNNilA0FcHDwf+d1EnXtFOVeTRnuInJ5xiEeMBKMBHiAQ+DpKEHt/H56RwbDkFCxpPFV1cRnFGcZl/7ysG4hHUK7Ho= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611830152; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=5AE+p0tuwffWob6HmHooeYjcx5+onHwSwoE0/M0ojIY=; b=XmTYIQFbdlO2Lb+zmR8vDtTAf1aImu+gg7/u+i8y0y6mYVplJOis5UBdGgobi6euYRdNBHqBJYGCW07NZdHgysmeM2E5bxsNiiMJKPqynRD0y2X5SIyScuiomG9Qu7L+BmWGSH9Yw5hvdS/lT8b13w4xxq/PeapGRBzW2X+kBVs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611830152388113.03217269977381; Thu, 28 Jan 2021 02:35:52 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.76870.138895 (Exim 4.92) (envelope-from ) id 1l54eH-0004NV-N7; Thu, 28 Jan 2021 10:35:37 +0000 Received: by outflank-mailman (output) from mailman id 76870.138895; Thu, 28 Jan 2021 10:35:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l54eH-0004NO-Js; Thu, 28 Jan 2021 10:35:37 +0000 Received: by outflank-mailman (input) for mailman id 76870; Thu, 28 Jan 2021 10:35:35 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l54eF-0004ND-Pz for xen-devel@lists.xenproject.org; Thu, 28 Jan 2021 10:35:35 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 92de7f99-ed55-453d-83f6-803ab00a0496; Thu, 28 Jan 2021 10:35:34 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D2BA1ABC4; Thu, 28 Jan 2021 10:35:33 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 92de7f99-ed55-453d-83f6-803ab00a0496 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1611830134; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5AE+p0tuwffWob6HmHooeYjcx5+onHwSwoE0/M0ojIY=; b=ugJlz96/S9SSOnoWHLv5VS81itOZ/omPZMnCys1rn1NrrLswHiYALdeMGQiC5meDswkcp7 4WyjUGWekIk7BXUxoDOl7O8R+tMvQxO7PnGdaxYUoozupum0Yi1+ja9ynexJcd5p2j9GtX aK134DGsacTxfd0Po/iCeCSP3UTHwVU= To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu From: Jan Beulich Subject: [PATCH] memory: bail from page scrubbing when CPU is no longer online Message-ID: <251a14b5-01a5-0a9d-d269-f463a0759f1d@suse.com> Date: Thu, 28 Jan 2021 11:35:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Scrubbing can significantly delay the offlining (parking) of a CPU (e.g. because of booting into in smt=3D0 mode), to a degree that the "CPU still not dead..." messages logged on x86 in 1s intervals can be seen multiple times. There are no softirqs involved in this process, so extend the existing preemption check in the scrubbing logic to also exit when the CPU is no longer observed online. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1324,9 +1324,11 @@ bool scrub_free_pages(void) * Scrub a few (8) pages before becoming eligible for * preemption. But also count non-scrubbing loop itera= tions * so that we don't get stuck here with an almost clean - * heap. + * heap. Consider the CPU no longer being seen as onli= ne as + * a request to preempt immediately, to not unduly del= ay + * its offlining. */ - if ( cnt > 800 && softirq_pending(cpu) ) + if ( !cpu_online(cpu) || (cnt > 800 && softirq_pending= (cpu)) ) { preempt =3D true; break;