From patchwork Tue Jun 27 11:22:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13294363 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C6BEB64DC for ; Tue, 27 Jun 2023 11:22:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 142558D0002; Tue, 27 Jun 2023 07:22:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A6AB8D0005; Tue, 27 Jun 2023 07:22:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E36228D0002; Tue, 27 Jun 2023 07:22:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CFCE08D0001 for ; Tue, 27 Jun 2023 07:22:35 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9E98F4097F for ; Tue, 27 Jun 2023 11:22:35 +0000 (UTC) X-FDA: 80948289870.21.1ED0E39 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id A432840009 for ; Tue, 27 Jun 2023 11:22:33 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=INgvN7iw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687864953; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2tWgJbMty0vF+sRGgcNfqljzE54wPeczugMOQkaZlck=; b=aMUq0G6Fj71t5il4LKRPkg610NPgnBvSuVSNqZwMgLZ+V8seUwM7lY2Kgqa5Qmoc8MN4rN Hg2IHb4c637DaZtSOlPaj8UQU/TVp3qGMwHTc0iPySdbsah2Y5Xmegfq9lnlISKxNTJB0P MCG4/dGLYa+WAcRZTVYwkYSODRoqrfs= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=INgvN7iw; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf12.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687864953; a=rsa-sha256; cv=none; b=Xi7B+bC1RyMcPnbHTga8h66To83Kv4C3q50tYmKRMTO668rW6yOKdquC3vOZ00aY6OXeNX OPMrsUJ25KjHlfaSsBzdVGQE8Igdg/HssihUZN2vxTbfM/5UbpoJF6Hkw1vBSVpPjV+YeQ WUACopcYUD1ud+SJTtyOrQ90N2kd8Gw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687864952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2tWgJbMty0vF+sRGgcNfqljzE54wPeczugMOQkaZlck=; b=INgvN7iwmHzx+7mw9lO1K3VTQ7BRQbiF4kf8wnJNs/dN/dRgTUVKhLw4jwrDE02xOEbzRB 7h7wpGORO97bp+1bXWUKIA/cEKK4rbkvH9XQQsmbCa0kYA80rE6mUPezccBi/o5/BA7m5t Es2UV9di4oUB42GgRFUwDHhsNbkhZhA= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-FJnFfwwzPY-Qr_PfD7F3LQ-1; Tue, 27 Jun 2023 07:22:30 -0400 X-MC-Unique: FJnFfwwzPY-Qr_PfD7F3LQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C720F381494D; Tue, 27 Jun 2023 11:22:29 +0000 (UTC) Received: from t480s.redhat.com (unknown [10.39.192.116]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1185200A3AD; Tue, 27 Jun 2023 11:22:27 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, virtualization@lists.linux-foundation.org, David Hildenbrand , Andrew Morton , "Michael S. Tsirkin" , John Hubbard , Oscar Salvador , Michal Hocko , Jason Wang , Xuan Zhuo Subject: [PATCH v1 1/5] mm/memory_hotplug: check for fatal signals only in offline_pages() Date: Tue, 27 Jun 2023 13:22:16 +0200 Message-Id: <20230627112220.229240-2-david@redhat.com> In-Reply-To: <20230627112220.229240-1-david@redhat.com> References: <20230627112220.229240-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Rspamd-Queue-Id: A432840009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: iogjzq18foxiebgncna4n19go9wwf5yc X-HE-Tag: 1687864953-967085 X-HE-Meta: U2FsdGVkX185KC/t+qEg7TX0e4f4Btj7507ubudJB8u7NShkJVJLhGDK32zUE+KtVGimBIZPU16VYELUrJ8fi+b4QDUs8c/M35E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rhiocRMsyii0YlF6n0zQoea66k6Q== 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: Let's check for fatal signals only. That looks cleaner and still keeps the documented use case for manual user-space triggered memory offlining working. From Documentation/admin-guide/mm/memory-hotplug.rst: % timeout $TIMEOUT offline_block | failure_handling In fact, we even document there: "the offlining context can be terminated by sending a fatal signal". Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 8e0fa209d533..0d2151df4ee1 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1879,7 +1879,7 @@ int __ref offline_pages(unsigned long start_pfn, unsigned long nr_pages, do { pfn = start_pfn; do { - if (signal_pending(current)) { + if (fatal_signal_pending(current)) { ret = -EINTR; reason = "signal backoff"; goto failed_removal_isolated;