Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755285AbcJMMmw (ORCPT ); Thu, 13 Oct 2016 08:42:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54572 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752669AbcJMMmf (ORCPT ); Thu, 13 Oct 2016 08:42:35 -0400 From: Heiko Carstens To: Andy Lutomirski , Peter Zijlstra , Linus Torvalds , Ingo Molnar , "H . Peter Anvin" Cc: Mark Rutland , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Schwidefsky Subject: [PATCH 0/3] THREAD_INFO_IN_TASK_STRUCT vs generic preemption code Date: Thu, 13 Oct 2016 13:57:09 +0200 X-Mailer: git-send-email 2.8.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101311-0012-0000-0000-000004709268 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101311-0013-0000-0000-000015CAA33E Message-Id: <20161013115712.29517-1-heiko.carstens@de.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-13_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610130206 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2150 Lines: 47 Commit c65eacbe290b ("sched/core: Allow putting thread_info into task_struct") made struct thread_info a generic struct with only a single flags member if THREAD_INFO_IN_TASK_STRUCT is selected. This change however seems to be quite x86 centric, since at least the generic preemption code (asm-generic/preempt.h) assumes that struct thread_info also has a preempt_count member, which apparently was not true for x86. We could add a bit more ifdefs to solve this problem too, but it seems to be much simpler to make struct thread_info arch specific again. This also makes the conversion to THREAD_INFO_IN_TASK_STRUCT a bit easier for architectures that have a couple of arch specific stuff in their thread_info definition. The arch specific stuff _could_ be moved to thread_struct. However keeping them in thread_info makes it easier: accessing thread_info members is simple, since it is at the beginning of the task_struct, while the thread_struct is at the end. At least on s390 the offsets needed to access members of the thread_struct (with task_struct as base) are too large for various asm instructions. This is not a problem when keeping these members within thread_info. The above is actually the same as the description of the first patch. The second patch is a simple compile fix and the third one the s390 conversion to THREAD_INFO_IN_TASK_STRUCT. Heiko Carstens (3): sched/core,x86: make struct thread_info arch specific again sched/preempt: include asm/current.h s390: move thread_info into task_struct arch/s390/Kconfig | 1 + arch/s390/include/asm/lowcore.h | 2 +- arch/s390/include/asm/thread_info.h | 11 -------- arch/s390/kernel/asm-offsets.c | 17 +++++-------- arch/s390/kernel/entry.S | 51 ++++++++++++++++++------------------- arch/s390/kernel/head64.S | 5 ++-- arch/s390/kernel/setup.c | 3 +-- arch/s390/kernel/smp.c | 1 - arch/x86/include/asm/thread_info.h | 9 +++++++ include/asm-generic/preempt.h | 1 + include/linux/thread_info.h | 11 -------- 11 files changed, 47 insertions(+), 65 deletions(-) -- 2.8.4