From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 640003AFD02 for ; Tue, 19 May 2026 15:06:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779203166; cv=none; b=OI9PlALdhLL7fh+NBmNFehYntF9h0y2RI0lzVU6f0ICrLUmoUGeKhe1/CcmrAS1YFOV56eupxv/3n730L9MmcGUvIfCssSw+za3ZMqsaqDpvIvUzr2Qkt2zhSMh2sCyBBFo3LV8YRVdbENy23V3zNSiYlO9b4mhlvsZxUUczy3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779203166; c=relaxed/simple; bh=GxitDJWFGQLI8bG3DKkwCxGXmWOfDazGvWruX/Cu07Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tbLk0aDr+unc5Isx/kC45PKmFeFsFk3mPUU1iCDVk1eqtjqdIntjVQvDuW32f+hKnu9ByEDV9pkrhQFtG/xrQvxH/DiWHsxdF3CBwGGVit6jwX9f8cun9F/Lkg8nqW+sKG+D66CtEN4ihN/NiP7QrshaEmYXVX1Aa05xBmQBnPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=IcXqw8m3; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="IcXqw8m3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779203163; 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=vxqvFXFHuMgyf3chI9C1G5KzlYp3YIeGxCZgkU30sxM=; b=IcXqw8m3jGXCuBQBJ7rHHqncXD8AwWmv2kd94kiUkkRywjXg1VfnvednvY00JqijW8ENoU wW4USmWHctRaTv35x5S5B2/EhybRsuzTl0r8oUmx/q6oxqj0+kKep+kdGqmwSVqZXgXEM3 jOW8du0cWBJ4wgzS36/z3NyYYYrwh1Q= Received: from mx-prod-mc-03.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-683-wMIBPt6xOCW6nB7bi8nNNA-1; Tue, 19 May 2026 11:05:56 -0400 X-MC-Unique: wMIBPt6xOCW6nB7bi8nNNA-1 X-Mimecast-MFC-AGG-ID: wMIBPt6xOCW6nB7bi8nNNA_1779203155 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2B7FB1956068; Tue, 19 May 2026 15:05:54 +0000 (UTC) Received: from fedora (unknown [10.44.48.45]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id EA60430001A2; Tue, 19 May 2026 15:05:49 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Tue, 19 May 2026 17:05:53 +0200 (CEST) Date: Tue, 19 May 2026 17:05:48 +0200 From: Oleg Nesterov To: Andrea Calabrese Cc: brauner@kernel.org, akpm@linux-foundation.org, peterz@infradead.org, tglx@kernel.org, kexinsun@smail.nju.edu.cn, adrianhuang0701@gmail.com, elver@google.com, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com Subject: Re: [PATCH] kernel: refactor: shorten has_pending_signals Message-ID: References: <20260519103316.122139-3-andrea.calabrese@amarulasolutions.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260519103316.122139-3-andrea.calabrese@amarulasolutions.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Hi Andrea, thanks, but perhaps you can cleanup the changelog? On 05/19, Andrea Calabrese wrote: > > In has_pending_signals there was a switch/case pattern that did not need > to be there, as the default for loop also covers those cases. Yes, but this code is very, very old. I agree, this optimization makes no sense with the modern compilers, but your description doesn't look accurate. The switch/case code was added on purpose, even if the default loop covers those cases. > This patch does not change the binary output of the file > kernel/signal.o. I guess you tested x86. Good. > A diff between the files gives shows (old -> new): > 2072c2072 > < case 1: ready = signal->sig[0] &~ blocked->sig[0]; > --- > > ready |= signal->sig[i] & ~blocked->sig[i]; > 2149c2149 > < case 1: ready = signal->sig[0] &~ blocked->sig[0]; > --- > > ready |= signal->sig[i] & ~blocked->sig[i]; > 2155c2155 > < case 1: ready = signal->sig[0] &~ blocked->sig[0]; > --- > > ready |= signal->sig[i] & ~blocked->sig[i]; > 9799c9799 > < case 1: ready = signal->sig[0] &~ blocked->sig[0]; > --- > > ready |= signal->sig[i] & ~blocked->sig[i]; > 9805c9805 > < case 1: ready = signal->sig[0] &~ blocked->sig[0]; > --- > > ready |= signal->sig[i] & ~blocked->sig[i]; I don't understand this part of your changelog, but I think it should be removed anyway ;) Oleg.