Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756124AbcC2NIO (ORCPT ); Tue, 29 Mar 2016 09:08:14 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37718 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbcC2NIM (ORCPT ); Tue, 29 Mar 2016 09:08:12 -0400 Date: Tue, 29 Mar 2016 15:08:09 +0200 From: Frederic Weisbecker To: Ingo Molnar Cc: Linus Torvalds , LKML , Peter Zijlstra , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t Message-ID: <20160329130808.GB7696@lerouge> References: <1458830281-4255-1-git-send-email-fweisbec@gmail.com> <20160325084847.GA15235@gmail.com> <20160325131732.GA16488@lerouge> <20160329094454.GA4715@gmail.com> <20160329125950.GA2768@gmail.com> <20160329130514.GA17315@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160329130514.GA17315@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1670 Lines: 51 On Tue, Mar 29, 2016 at 03:05:14PM +0200, Ingo Molnar wrote: > > * Ingo Molnar wrote: > > > > > * Linus Torvalds wrote: > > > > > On Tue, Mar 29, 2016 at 4:44 AM, Ingo Molnar wrote: > > > > > > > > Harmonizing thread_info::flags does not look easy, given how much assembly code > > > > accesses this field. > > > > > > It might not be too bad. > > > > > > For 32-bit architectures (which is still most of them), it's just a > > > > > > unsigned int/long -> atomic_t > > > > > > and for 64-bit architectures you end up with three choices: > > > > > > - it's already 32-bit (alpha, ia64, x86): > > > > > > unsigned int -> atomic_t > > > > > > - little-endian long: > > > > > > atomic_t flags > > > unsigned int padding; > > > > > > - big-endian long (only powerpc? Maybe there's a big-endian MIPS still?) > > > > > > unsigned int padding; > > > atomic_t flags; > > > > Hm, that indeed sounds fairly nice and doable - I thought some architectures do > > have a task flag above bit 31, but that does not appear to be so ... > > > > Right now we seem to have 27 bits defined in include/linux/sched.h, with 5 more > > bits left for the future. Here's their current usage histogram in the kernel > > source: > > > > PF_KTHREAD : 68 > > PF_MEMALLOC : 65 > > Argh, my reading comprehension skills suck today. > > That's a totally useless analysis of task_struct::flags, while we want to convert > thread_info::flags... Actually we want to convert that one too :-) In fact I planned to start there.