Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756178AbcC2NOw (ORCPT ); Tue, 29 Mar 2016 09:14:52 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35383 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbcC2NOp (ORCPT ); Tue, 29 Mar 2016 09:14:45 -0400 Date: Tue, 29 Mar 2016 15:14:41 +0200 From: Ingo Molnar To: Linus Torvalds Cc: Frederic Weisbecker , LKML , Peter Zijlstra , Thomas Gleixner , Andrew Morton Subject: Re: [PATCH 0/3] nohz: Convert tick dependency mask to atomic_t Message-ID: <20160329131441.GA16300@gmail.com> 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.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 44 * Ingo Molnar wrote: > That's a totally useless analysis of task_struct::flags, while we want to > convert thread_info::flags... So going over to arguing about thread_info::flags: 1) We already have ti::flags accessors for most of the generic code. There's a few outliers (in the scheduler code...) which can be fixed. 2) We could introduce a ARCH_HAS_ATOMIC_TIF flag to do per arch conversion: this would trigger #ifdefs in the accessors. When an architecture switches ti::flags to atomic_t, it also sets ARCH_HAS_ATOMIC_TIF. I'd still do a flags => __flags rename of the field, to make the conversion easy and safe. So any arch that has ARCH_HAS_ATOMIC_TIF set provides an atomic_t thread_info::__flags field. 3) The new accessors under ARCH_HAS_ATOMIC_TIF would use atomic.h functions to shuffle the thread-info flags. 4) After one kernel release we could add: WARN_ONCE("please convert thread_info::flags to atomic_t!", 1); to the old accessors to accelerate conversion. 5) Eventually, once every architecture is converted, we could eliminate the old sched.c fetch_or() macro. Thanks, Ingo