From mboxrd@z Thu Jan 1 00:00:00 1970 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 0CE68C369D3 for ; Wed, 25 Sep 2024 12:06:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 972C36B009B; Wed, 25 Sep 2024 08:06:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 923566B009C; Wed, 25 Sep 2024 08:06:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8115A6B009F; Wed, 25 Sep 2024 08:06:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 68F9C6B009B for ; Wed, 25 Sep 2024 08:06:13 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2BC861C6883 for ; Wed, 25 Sep 2024 12:06:13 +0000 (UTC) X-FDA: 82603132626.23.B3636C9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id 175AEC0018 for ; Wed, 25 Sep 2024 12:06:10 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CxLydxnN; spf=pass (imf22.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727265910; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QpX/TrTSTrn05ELx0yxQcZCW8GhD5VWBMkrKywZYZWM=; b=KkkO2VFZucchrNSmpgENiIJsPO40Ajxx3woGiPgJgY2k4EfmRpf4wfsKjr8AUUeTCF84/o iGYh0bE2Th+u/2/6DeeFMvwxBEKdFrrmHZ4I0KI7jKIsx991cBaBJAyNF2rpn/X3AY6h6P 9/m19h2fhV2Z5F9/x3WjMTlRk9o5lGA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CxLydxnN; spf=pass (imf22.hostedemail.com: domain of oleg@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=oleg@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727265910; a=rsa-sha256; cv=none; b=2+cWNNIZcMbNq5VMt4NCmYzcGVa195+MW/PAEvcQxTimglgBZZV4ZkEy2jGYtzVV4DlJrq zBJzyV1GOtXvEjU09THJsIe6P+B9VjyIxmQxqBIsNQ8HHXh8YkiI2wyxCl7Lr2PSmiEPbV m5jOCs+MGkFdsRqvbH7tMJohMTLS3uk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727265970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QpX/TrTSTrn05ELx0yxQcZCW8GhD5VWBMkrKywZYZWM=; b=CxLydxnNN/Do2vwoqw4zkY7CXMk7Yp/ccqHpXqfXEacdXUJ6kIWCLhBuBvxWEj8lVYzwlH UVLzW0D+0JLNYqTJwRpOEQfbM4QuphF/CIHeXz+FZew1c5XTjKPHdo2BFHWo2YRmiZK74j UySwNNXJSGZgZ5Di5wccLF0YaeaSxxU= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-Y38F58PyMyi3vXMADCKbHg-1; Wed, 25 Sep 2024 08:06:07 -0400 X-MC-Unique: Y38F58PyMyi3vXMADCKbHg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 84256193E8E8; Wed, 25 Sep 2024 12:06:04 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.67]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 24556195608A; Wed, 25 Sep 2024 12:06:00 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 25 Sep 2024 14:05:51 +0200 (CEST) Date: Wed, 25 Sep 2024 14:05:47 +0200 From: Oleg Nesterov To: chenqiwu Cc: corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, paulmck@kernel.org, akpm@linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v4 2/2] arm64: show signal info for global init Message-ID: <20240925120546.GA26882@redhat.com> References: <20240924074341.37272-1-qiwu.chen@transsion.com> <20240924074341.37272-2-qiwu.chen@transsion.com> <20240924183634.GB17395@redhat.com> <20240925035440.GA2941@rlk> MIME-Version: 1.0 In-Reply-To: <20240925035440.GA2941@rlk> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 175AEC0018 X-Stat-Signature: zu3pte5c9neuwtoe15ikk4qxqm9rp4mo X-HE-Tag: 1727265970-410504 X-HE-Meta: U2FsdGVkX19n1OWumLjwiBPTYBq++2iKUV9JN2Ah/c+T3nbrSkWf3+icMAf+bp9ZvBvYMBw29/rUC4bIjdetcLy4ZjPIowQzKXlPH0pc1xhyZFH/KYAdzLsCpNi6cQURWJEFmo5TUOKdHXZgv9OxIW2a2YLrchppj5ygcViNJwMtdsHktjE7AVPAP1HL1oIPJ3yIleCfZYnkiFYEkaOaWghTB7Bt/qg6GkC4MyYmKS57HUWjEQXNT0KiPVRB/fmz7RuL8ta2P0P+VrhwZFs1bBeo3uLW0kVhH/bPuuZx7A9fAJvxOx/+LYH+k5ScKJobwS+F1WFFMJdNQ8wVmadRejerJzZysxMOWR9NnFwiQn8ZeGWF0Xf6JRZroBVcTgnVOjutRattf1TVJCyPwA9ga6mHwrNAlkkg2qiLAvoO7FHbD7MwTVTETUxUdazrC+CGDHowApe5PVxg3dJIYUGlJ0ohlzQHeUibm3LPRx5ztp16tps/grBaluWVNQPbTbzWVdCR+Wl077euvs6xzJbPgZegsftRNU9HVwNwlxB4SCEBVhP8iyKk1O8wRPhHTdQVbv60GIDVTP7Qq5qUaberqNErUdOO0fYtSl10yCUmYaVr6CJCHpsreoLKHtn3ahA79yHT2pZNO7Z2Tzzrys0e3W5TS0J0vWoafYTxScN5lywwXfhIzXlVzSKFPYLRaraOZbHclinWGtMgTBPphSNjWnFsS41e9ZI1G/K9G5mmngowLdiehDYTegtHn9Vv4CgQfSBB3zFylhQsOBRPGAm/lNxUN5K0M2AYy7hFmG7bqPg82Ym1rhJ+VbHIYQaQ8b9DutUb+fm1OK9QL+TISuAWANNo5YXbjEBLdChQ0GD6I1RDr2JrlnaSrXD5oiapXH0AFAE+IUwVlB0B7mY2OP6p9REZFiDuvfROwRzzXXuyhMUZoUznclahoJuEnYw2pnzzwncs9AWX5xABeVhRw+P fm72LgB1 uNwpxk+Jb6VC/plYupbSw61mIN+leQyT5HKg+TaStQiA6hu+y1UvYhGlmephOuahUcW/IKdsibuA37MI7MGJ0rbfuNV+QHDycc5rxLHohWWbDjvyeAkQiizFyUVRzG3lr0gdiNgu5c5rR8SH8FfU5ZOgC1sfL+G1laOl4sMa0yp+V0rpvHvkheQuec2Brq6GmmrhuzuzKxK9FFWXGlU3LFKVRRqrSfpu/1Vh07V+kovHJrTeD34WVdgmUTmtU7/ShInY9dZLKUFYSzpMjoMu0Imzs5cQCEEa6pve8NH+Q2fzIY0uneVTp5TDeubN7zPSTikO3cQltUnnI5Ad4SP4JhLIVw8cFOBk1dfYA X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 09/25, chenqiwu wrote: > > On Tue, Sep 24, 2024 at 08:36:35PM +0200, Oleg Nesterov wrote: > > > > So what does this patch try to do? Note that unhandled_signal(tsk) returns true > > if is_global_init(tsk). > > > > So it seems that this patch just tries to bypass the show_unhandled_signals and > > __ratelimit() checks? Or what? > > > Yes, this patch just try to bypass the show_unhandled_signals and > __ratelimit() checks for the global init. I think the changelog should explain this. But this doesn't look right to me, see below. > > OTOH. The is_global_init() check in unhandled_signal() (which predates the git > > history) doesn't look right to me. If init has a handler for, say, SIGSEGV, why > > should the kernel complain? I need to recheck this logic... > > > I think the orignal logic is the signal sent to the global init is > regarded as unhandled becuase it has SIGNAL_UNKILLABLE feature. And? How does this relate to SIGNAL_UNKILLABLE? Again, this check predates the git history and the SIGNAL_UNKILLABLE feature. And SIGNAL_UNKILLABLE has no effect in this case, see force_sig_info_to_task(). I am running this program void sigh(int sig) { printf("SIGSEGV %d\n", getpid()); execl("/usr/bin/sh", "sh", NULL); printf("exec failed\n"); } int main(void) { signal(SIGSEGV, sigh); *((char*)(1234)) = 0; return 1; } as a global init under KVM. It works but dmesg reports init[1]: segfault at 4d2 ip 00000000004006b5 sp 00007ffcf2975170 error 6 in init[6b5,400000+1000] likely on CPU 0 (core 0, socket 0) Code: e8 c0 fe ff ff bf 6b 07 40 00 e8 56 fe ff ff 90 c9 c3 55 48 89 e5 be 56 06 40 00 bf 0b 00 00 00 e8 80 fe ff ff b8 d2 04 00 00 00 00 b8 01 00 00 00 5d c3 90 41 57 41 56 41 89 ff 41 55 41 54 I'll send the patch which removes the is_global_init check from unhandled_signal() which actually has more problems, afaics. But this all is offtopic. Oleg.