Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2285172ybe; Tue, 3 Sep 2019 10:30:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOHAOkwNBFO+rRycSyL3pHs02POObfMkC2AQ5H8MT/NvfARMqsVehezN+pf9nNfxGZP3xW X-Received: by 2002:a17:902:3204:: with SMTP id y4mr37138534plb.156.1567531838543; Tue, 03 Sep 2019 10:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567531838; cv=none; d=google.com; s=arc-20160816; b=cmASKGMe2qlLs3ebgyeFFezBpRjgwGMnFdecTikrx//RuAlnt7WBbnGYXWOsgouDx1 zwttHgqiUHghDwmLa5HxUDtxCA1UFyyu2SjhKoKMLiM5BqGZNjfxz+OoMfi+G1Oy633e 83U02tcWXHM9hB5EcwTYP4oCEjTcOc1O6zkmlVcW/mASmeESoQ0syNjnVV0DdEs7vJ9V rP6pfxtSpuWIRZQ94eF7e3OxXh3uNdsDi5CtWbf/nlJ9JV9awDnDMOl0fi3GG5H3czMF dQo1QXIcWtn8FkxthBqOyZUw7JI8Kj9DQQ8wPfz2uBMzI91iH6dO4r8aE2WMspB6W3x2 jvyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=CLSXeEVTo1ZKv6SB0jpUp+nrbpj4hZwEwfhBw3mt4Rs=; b=Ef61LxpU1o2G/E1A7b+EbbeasWOmIO5UyhoY8wI6CmojI2MEkK+B3V+8qIvIH1CYHw CuLsAgaflrB6suJZoQ5ZNEhIgx/npC5jsRhh9XRi2lSBePGgJl6pQyr89B5RAtNlpZJq DPGrxfybXSlRYPQCtbGmHBk0hzlZki70Pi2h4uxuDDTfykIfXX9HJx6RyaHVTv31VAla sw+z5/aR9CpP8iWzngAFOZJNwGOx8ztZ9miSyaqkNYKIXlqRFMAAg9Zo5gxehdsFh816 3OQqhgI2/Dv/CtQx4HZi4nT0aRX9Lefkf3ifEny/p+AhIvl8G71nms9r79ULG/u5VmxI JhsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91si15468805pld.380.2019.09.03.10.30.22; Tue, 03 Sep 2019 10:30:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730165AbfICR3K (ORCPT + 99 others); Tue, 3 Sep 2019 13:29:10 -0400 Received: from foss.arm.com ([217.140.110.172]:41538 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728571AbfICR3J (ORCPT ); Tue, 3 Sep 2019 13:29:09 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52AB3360; Tue, 3 Sep 2019 10:29:09 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3302E3F59C; Tue, 3 Sep 2019 10:29:08 -0700 (PDT) Subject: Re: [PATCH] sched: make struct task_struct::state 32-bit To: Alexey Dobriyan , mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-block@vger.kernel.org, dm-devel@redhat.com, axboe@kernel.dk, aarcange@redhat.com References: <20190902210558.GA23013@avx2> From: Valentin Schneider Message-ID: Date: Tue, 3 Sep 2019 18:29:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190902210558.GA23013@avx2> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/09/2019 22:05, Alexey Dobriyan wrote: > 32-bit accesses are shorter than 64-bit accesses on x86_64. > Nothing uses 64-bitness of ->state. > > Space savings are ~2KB on F30 kernel config. > > Signed-off-by: Alexey Dobriyan > --- > > arch/ia64/kernel/perfmon.c | 4 ++-- > block/blk-mq.c | 2 +- > drivers/md/dm.c | 4 ++-- > fs/userfaultfd.c | 2 +- > include/linux/sched.h | 6 +++--- > include/linux/sched/debug.h | 2 +- > include/linux/sched/signal.h | 2 +- > kernel/freezer.c | 2 +- > kernel/kthread.c | 4 ++-- > kernel/locking/mutex.c | 6 +++--- > kernel/locking/semaphore.c | 2 +- > kernel/rcu/rcutorture.c | 4 ++-- > kernel/rcu/tree_stall.h | 6 +++--- > kernel/sched/core.c | 8 ++++---- > lib/syscall.c | 2 +- > 15 files changed, 28 insertions(+), 28 deletions(-) > It looks like you missed a few places. There's a long prev_state in sched/core.c::finish_task_switch() for instance. I suppose that's where coccinelle oughta help but I'm really not fluent in that. Is there a way to make it match p.state accesses with p task_struct? And if so, can we make it change the type of the variable being read from / written to? How did you come up with this changeset, did you pickaxe for some regexp? [...]