From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9A58C43603 for ; Thu, 19 Dec 2019 18:39:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C9E924686 for ; Thu, 19 Dec 2019 18:39:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780788; bh=7+IO5IoNu/pMLBYghFbd4C+cTy8Wk9Aywd1ymMe0B1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=L6Ru5ZFcgoT1OvlonsfcDSvW1OEUa6DRb/JnlA+3xpPkYlXDYFZs3OP8dVJ8gOR4e 0MneLMWQ5b2fVdtSiyNiSSrJWyfcpDNd41+YEkqNtU1X+rPNmZZhrKs8FnBAg2FIU8 x0+dioImE6+ufWTLkDltaSRgXKD59cXI5qWFejFI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728281AbfLSSjr (ORCPT ); Thu, 19 Dec 2019 13:39:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:58110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728267AbfLSSjn (ORCPT ); Thu, 19 Dec 2019 13:39:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3482224650; Thu, 19 Dec 2019 18:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780782; bh=7+IO5IoNu/pMLBYghFbd4C+cTy8Wk9Aywd1ymMe0B1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkp2i4M2WQrCiTzp1Luwc7st15TioRSy6PznXEtYlWbj0G8cr20KZ1k8T27W1lqjI 3JZIc1kmfvIlSmdAqvfRsyeC92nTqoRHGQu5Yf9YCBxVYkwKY2e+SHUiDT4dvpWST5 ioioWJjYGlOHcVOqj1EU+MVpECa6GM5caxTsJGeo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiko Carstens , Mark Rutland , Thomas Gleixner , Andrew Morton , Andy Lutomirski , Linus Torvalds , Peter Zijlstra , keescook@chromium.org, linux-arch@vger.kernel.org, Ingo Molnar , "zhangyi (F)" Subject: [PATCH 4.4 077/162] sched/core, x86: Make struct thread_info arch specific again Date: Thu, 19 Dec 2019 19:33:05 +0100 Message-Id: <20191219183212.482196665@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiko Carstens commit c8061485a0d7569a865a3cc3c63347b0f42b3765 upstream. The following 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 CONFIG_THREAD_INFO_IN_TASK_STRUCT=y 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. Signed-off-by: Heiko Carstens Signed-off-by: Mark Rutland Acked-by: Thomas Gleixner Cc: Andrew Morton Cc: Andy Lutomirski Cc: Linus Torvalds Cc: Peter Zijlstra Cc: keescook@chromium.org Cc: linux-arch@vger.kernel.org Link: http://lkml.kernel.org/r/1476901693-8492-2-git-send-email-mark.rutland@arm.com Signed-off-by: Ingo Molnar [ zhangyi: skip defination of INIT_THREAD_INFO and struct thread_info ] Signed-off-by: zhangyi (F) Signed-off-by: Greg Kroah-Hartman --- include/linux/thread_info.h | 11 ----------- 1 file changed, 11 deletions(-) --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -14,17 +14,6 @@ struct timespec; struct compat_timespec; #ifdef CONFIG_THREAD_INFO_IN_TASK -struct thread_info { - u32 flags; /* low level flags */ -}; - -#define INIT_THREAD_INFO(tsk) \ -{ \ - .flags = 0, \ -} -#endif - -#ifdef CONFIG_THREAD_INFO_IN_TASK #define current_thread_info() ((struct thread_info *)current) #endif