Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3894831pxb; Mon, 8 Feb 2021 02:53:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxxASBC0bPkzZKImRkAuGiR9w89n8ZDS5QL7leYKR76W1sALg5wqT7YeAoWgKyIfxkomNC X-Received: by 2002:a05:6402:430c:: with SMTP id m12mr17046314edc.299.1612781630615; Mon, 08 Feb 2021 02:53:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612781630; cv=none; d=google.com; s=arc-20160816; b=dQ44c8qPbPlD0nBOkD3IbTH7snPGmGEO22couM29PlGA6/txJuyuq5F7NmSLcgiyqe nWcGTzS9JZmAT26eqjqoCQLdf7xa9+YiJVQDCJP6Q8qnvZ4+nvhgi/BJz488g+SytcRA W/X1h48hziyK5lEC1M8jduIYN/CQpHP1xWqCm384ePBHMOLqOLAFGAM3gprh3LD86RBp PIE6wo3fQcO3+G1bl8O7LBgbIUdXhTWtHr6tfdzonbCjKucidy0sopKjgTv5Ha4GO7E7 YHuw3Xkt1uFejV/NjuHkfU/YS8doPbKsZvZ71oddIzBIuXv/jjFEgaNCzvZtfGkRj59Y 5EaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7xqCx4BT8WueOU2RkvLHCdkxtsw/O5oz5D05YzZmJsw=; b=wSww+V8Bodt8CaaHgknQDPQEBZ6STiUjqyV2eZ3UmdHKz6d3tjIaK+pD6gVZMnSJUW H7yNYIL4nDJhorvPpHghGj6Ag6hV0ftlFS62+DdocrSWYcOwP7dRhAxBEYYrt8oEzZdE B7LhBJjKTog8IriEprpQq5t3cLV79ACj6STDuhjOAve3rvnr6MWZN+9GykNQ6uGbpi+u 8IahHOnwQDtZSVhPBvQFcLDtJj7fwzzk9vXnxDgjYZ4aFhkCWdbzjFfQmmGJCdVFIt7V cDmRWma7ot2pw5HxFVGF0XVB3g5363eTxai9akc+WLGCbPusPFfQjIXOH3sToUBC9dYv 2rDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=dHRkaR5T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x23si10870428ejv.558.2021.02.08.02.53.26; Mon, 08 Feb 2021 02:53:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=dHRkaR5T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbhBHKvR (ORCPT + 99 others); Mon, 8 Feb 2021 05:51:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232528AbhBHKkJ (ORCPT ); Mon, 8 Feb 2021 05:40:09 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BF25C061756 for ; Mon, 8 Feb 2021 02:39:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7xqCx4BT8WueOU2RkvLHCdkxtsw/O5oz5D05YzZmJsw=; b=dHRkaR5TrOPAJJx1zFeeoRhfv0 xy0iUjkgsZ5kOzdrp1JpsO/Nuu1bZtcPvz5SOmdfSCwjI+Chtj8nRqf+yhnZu+PEHhg76HaQenaob Vu4eC7hON51qCR3SlHUJSgpEEkXLQ9c5rxWxVIX9qGWKQlRCD7Idah+3XgtYQmzn8dOaVahEv2Zqt 5tXCpprZByi3SkfdIKmFF5V794CZRleQHe+/Dw7HwzloA1cD5Mtbs2kBNiooYHfZ9ihzbONYK6h0F NMWAK4QMzKuiCeADdtxy2jm0FvUH7nWMCXzA6lUNQ7LblDo2kZP3UPxOTerGwbEf9VCTzAhijPjY2 4nROpgog==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l93x0-0008RM-Ck; Mon, 08 Feb 2021 10:39:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 346AD3012DF; Mon, 8 Feb 2021 11:39:25 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 222D02BF248D5; Mon, 8 Feb 2021 11:39:25 +0100 (CET) Date: Mon, 8 Feb 2021 11:39:25 +0100 From: Peter Zijlstra To: Alexey Dobriyan Cc: mingo@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] sched: make struct task_struct::state 32-bit Message-ID: References: <20210206151832.GA487103@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210206151832.GA487103@localhost.localdomain> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 06, 2021 at 06:18:32PM +0300, Alexey Dobriyan wrote: > 32-bit accesses are shorter than 64-bit accesses on x86_64. > Nothing uses 64-bitness of struct task_struct::state. > > Propagate 32-bitness to other variables and functions. You're saving a handful of bytes, why? > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -655,7 +655,7 @@ struct task_struct { > struct thread_info thread_info; > #endif > /* -1 unrunnable, 0 runnable, >0 stopped: */ > - volatile long state; > + volatile int state; A much larger, but probably more useful cleanup would be to get rid of that volatile.