Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753755AbdFSP4D (ORCPT ); Mon, 19 Jun 2017 11:56:03 -0400 Received: from mail-dm3nam03on0056.outbound.protection.outlook.com ([104.47.41.56]:35699 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752112AbdFSPwH (ORCPT ); Mon, 19 Jun 2017 11:52:07 -0400 Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=caviumnetworks.com; From: Yury Norov To: Catalin Marinas , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Cc: Yury Norov , Adam Borowski , Andreas Schwab , Andrew Pinski , Bamvor Zhangjian , Chris Metcalf , Chris Metcalf , Florian Weimer , Heiko Carstens , James Hogan , James Morse , Joseph Myers , Maxim Kuvyrkov , Nathan_Lynch@mentor.com, Prasun.Kapoor@caviumnetworks.com, Ramana Radhakrishnan , Steve Ellcey , Alexander Graf , Mark Brown , christoph.muellner@theobroma-systems.com, davem@davemloft.net, Geert Uytterhoeven , Alexey Klimov , linyongting@huawei.com, manuel.montezelo@gmail.com, philipp.tomsich@theobroma-systems.com, schwidefsky@de.ibm.com, szabolcs.nagy@arm.com, zhouchengming1@huawei.com Subject: [PATCH 08/20] thread: move thread bits accessors to separated file Date: Mon, 19 Jun 2017 18:49:51 +0300 Message-Id: <20170619155003.13218-9-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170619155003.13218-1-ynorov@caviumnetworks.com> References: <20170619155003.13218-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [85.253.137.34] X-ClientProxiedBy: VI1P190CA0021.EURP190.PROD.OUTLOOK.COM (10.165.188.162) To SN1PR0701MB1870.namprd07.prod.outlook.com (10.162.100.20) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR0701MB1870: X-MS-Office365-Filtering-Correlation-Id: a375c05d-d1c0-471a-fd79-08d4b72b1dec X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:SN1PR0701MB1870; X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1870;3:KpArFqkfv+X1lCyO2Y95zppveGB6UGHesc7dGvhQ+GD/xTA1b/168PD5UKsv1+xYNoVvb0l3rmO1x8v7/WfE5B/eEDDqPEtzzrzY/oqU33lKMRn2xf0sfjta+znCER3AH7cqZ7J9gZPdhNgpYnkq76H0lNW2kAmnbkzRBIlv6vbCUnpdW8A+bQsT7IgqSCkLap6c0Hx5TNc5ad6Ev995tgYmxZIt0jStLQfREpgPgSyBC95gRcjdVwwQzV8V5SAy9YigXNxNV+p2QtwIdl/LrLqmsZ6eaE9bCLl+eQwzZc08gqkT9GIo3OcTFpptA9Pl2LDeM2ge7xb1hoaB+nMoEQ==;25:rgPDJ6w6YyW8KUMXhvSU4UxdBUGEAJKA/AzP/09IVdmxT77Mfew5BCXWAPvu0xbRkgpq+kJSJgupC9QQ6WZ+bIJ/aQSS7VpiZh4Rv9q4oMNm4nbUXCx9aITdyZ+8ivMkm1KPMOt6mwTygt0T7hw5pI4gJy106M/Vy1+pkN7l0pnxlkircCWIbgB3Wl16KSjODhlDbpIz+Ppz3+0GyFJLcvtzfR9wCsQnVCqjkQPmeCTiGPZInFzvVwy+sVWJ3nkAsIRXzEoMXvuci+wbRqrH8FyvU+6xYZp8IHf+wtN6rnratVdB8v20r4DlkuIiOpfeejMlFyDTbvPhKA2iCNECpKc+7JHNQalqD0wDMD3ivs9ZFSEYygqAVl0hS8jTw/S7pb8jAQv8jgQk96wv7suVRmWlaTTnG1aW0z5HXZiGMZtnN4LEjtzkpBiLB4akT7zKZwZxc5qHU8qqe+Ryn0MOllebGDeu9UqovGhPBpISyIQ= X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1870;31:mm6npPla5eKz7WjYfsWkVr2t8h8tES5cjmMgAAs9ge80AcDROkbobBPkTZdBiHxc8ArAxk9SKrCCxQ0TAhyA5DgmhlUleNn+VTq7Qe3WdKinwXhLkp9cY8JXwQ64iXXYBki2Njvn2m1F0ACvb/OPhHARPGWNw9F9OL71eeApDQSRNjQb84J/mYhVfWrdfAGigOU+tQECJKpTip549pcn1875Vk9mOU1Aaaf+uUbfqqZTxGHb3QqMs1jxFQ8sJrjyu+UzM2x12AuHRxrNJvKNJQ==;20:S4uq6G2213R/wLZk4SSeTGpUK90RPI4p8UN4xaA5IiTxjzhTqeBHe15+Sg9kEoA8Hur5B/QOtkstgHzgvQPzNhJXS/W65PiYkeiJDAMHA80vpugkf2k+bqm7mkymk5ljKGTn8x25tIa9wRPvYGYeIIz0dGnq9kWubdtfYmg3+kSwVOKE+PFGyhSM2Hk2sBiHwb7Z+bEHD+AQnUamPdlfoi6voynQLTUYfh8/9CKrg4FhkwQYv4PVTVNUQNWuV0Pe9mIb0QY/iPNioZmdaN4YUWtJXaZmMyrZZ623c13QXCDbb8zUSPdKlGdQCCtteLboTKI0lHUI1YGSUe/K1UUSEPgcLckuy2lmBNLbh1a6nmsYWD1EOouuI8it4cg2KLePFRsOrgEoZI6J6LVOHRxxchLnzRtRllqIBCRNcag7bi9M9nd8P8Zd5qkbHxhIPTKsrNavJrKtbUOVY/8J/qnnJKE+2hWli3kmo8NZ8O+JSFNvw49CZPVLdUppNYkhBZCEztLJoatJj9XgWEInLhlV3GyowCsuFCjD/n+cfanWK2x7tf2b0xdzEZh2Lld5ynSBI4ubfSJdITPzzM4C3wKI49OF3shZE3zWTnxba35bYMs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN1PR0701MB1870;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1PR0701MB1870; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1870;4:KRFlJEhPI/xUgQ3mNVdmMvKZ83lYqwqT/IqUs54+?= =?us-ascii?Q?bKC/5IbuAK2K8z2eCGPXEREgcOWSAISvdt9VA/lBjCV41dYkw2YCzvoouJ1U?= =?us-ascii?Q?+NWoIZNn78ScZ4YC0uLOPEumWBAr5R25LiciB9Mk7riOcL6o5h/Oku32nS04?= =?us-ascii?Q?hcNKm4q5wDSvlydARPgcDTDZ1KsX5wFNNTyzY6EtT3XMbpVQUS9cwYuJ8kfW?= =?us-ascii?Q?MmY83X4QfNO05rgpwm9Thf45ExqZfjxe7GaaLB2I3eU0A9T0AkVtONhZSjDO?= =?us-ascii?Q?izWRFbDuEpgKtrDelqIf+Oh0MGPykG08R3LsYHKCwJz7t64mo7NFlqD6xWDx?= =?us-ascii?Q?CBh2HFdn9s28z67flKe0Gb0Lnt6MnZESboCEvyF7h8EfD/qoDaNUgqGC+BxJ?= =?us-ascii?Q?Ud4GipTDxYEUKUFs9JhyTmD58fqMDP/RCJW8u36QlrjQHxE/vSGwT9llmIDa?= =?us-ascii?Q?+zmsw8uLNFLfiXo84QlBYbtJh9lZLEznLC7s5M9vybWXKSgbq2PRGZ9YJ/QF?= =?us-ascii?Q?+Ppcbu/byxjwrTYo6aBejthWWOcI9yebkxoAtsv3M81NEIXqNQTrFJsaAMIG?= =?us-ascii?Q?1qBoTPM6P41Imr6H82SEo8QPLBmWw/J5rDCxEd3+u3KIgYJ7A9zQM6qE1Ej6?= =?us-ascii?Q?vtTDPqfTOoStn5XZXQjUuQsvuRImKhqL53tEMLW7xdzROCOAJFAaDRaM+DSw?= =?us-ascii?Q?zlsUop1skUJZm4wHht7S8lwWBlb93hcj76s9FHuhlU75l007ZvrHq+viZ4oH?= =?us-ascii?Q?WpuykX3Vu1lz4ZUrwvPynaGWLk5WUZFQ8+3HK0eps2Q8j2bvXVrI6j4BJaOc?= =?us-ascii?Q?k/X8eGpTMZAA+Q02xw3jaICH3TXEgsRhLf5qxcBD7Xvf3ns6XfgfqPBOEx96?= =?us-ascii?Q?Zc3gx65mDsntsrM8XHL10HNG0TnpfwIxpD+XCWF9g2t5wv0q1zJYUfxc9I+P?= =?us-ascii?Q?/BBW3hk+iYA7Fyb3SAPyLmPj4k4NhjosohOPYZWswZ1JhEYuhkCblJ4mBTik?= =?us-ascii?Q?1qW2nJBT4Np1lg0Qx3vP45c2F3VkzkuIyjTa8Xu+t+kVxq39EG9immq2WG83?= =?us-ascii?Q?66yMQgKgQmrRZvLGXftFCylg3atqvU65Zz+IzaWlToGzoRQnJPNLvSaXWmY/?= =?us-ascii?Q?8EY9uv1BRVE=3D?= X-Forefront-PRVS: 0343AC1D30 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6069001)(6009001)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(50466002)(5003940100001)(1076002)(8676002)(50986999)(33646002)(48376002)(76506005)(5660300001)(25786009)(6116002)(2906002)(47776003)(76176999)(189998001)(66066001)(3846002)(50226002)(81166006)(38730400002)(54906002)(478600001)(72206003)(53936002)(6486002)(2950100002)(42882006)(6666003)(6496005)(42186005)(7416002)(7736002)(7406005)(36756003)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR0701MB1870;H:localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN1PR0701MB1870;23:qOto5RzSnApDgiJRdpwiBPOu1IU/qt9ZT8yz8nn?= =?us-ascii?Q?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xA8RCEq3fW5k8nHZ4VTSuA8mKkIY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR0701MB1870;7:5pePmujWDq1eQpTiW8tQYD303OUsfTCbjRvFqxKpYZVhQ3JhVSFjWBbjTsYrKOxfw2fryMUM5T0xlXMPNIhBxBcOAnVDSKDBOqhCXYsHOOVZ8WGrknz1xph0K6XOscDMOMX0aZrAUbAd1HYfHqwPQxg5yh3fU0lsQKs4HqVaRElp737MlSLoDIJZbmLWZG/GNQLHgyME+Z0otV7ozFx5P9kj1r7fVYPrWycWx6oE4UefFWa2wVcsJ2qsJUy/TjmycAhdSS9eLSrBFjt5sp8l6bbhOqQfq5jLhGfQN17cc6/YI2cMlEyXaKDFtbgQoncBzgw3JQtn5o+lZfc+Jr+lQxDQu3WgQItJKTGKnmlYIVbhXTgqWWah7x1AT//LyaQ6z1PrktjcCGKFA+H1bwjjIpxj15FOJlw1z72nlM69KVZ2paQqtftphqv3MkHuR9iTyw+WQ7l+tu8P37pQGMqL3WHeptdcn0cx8euZEc5qjy1Ro+ffz12hzS0EUzxbB9+DjV6Q02WT7Z+Vb1oDpN/QJtCQy7wgg9FiK1Rc7JNyXxHBOdBzokZffn5mi5Xcq6BZ62ULKK2GdRCftipRYqoeG+6f7Gc5Vh4xN3iQrfkzRoOB0JFtW4zsOeGJzZxkseqyJUCe6l53fg7hy7UUCG8Xe4B2IIphYkAUFJ3Jt3UPRGsKaihBT0Tac3Dxq51TGuRhoPBaDzZlYSaDkZSB9e5KZUrsv+2YfHgLlYz6bLsNZAyYZXj3fveLIg/Rkp4ItIhrbmpaObfkeYPDtA2JM2qnIIMMUXC0u69TdpXCdGhUOEc= X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2017 15:51:57.5254 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0701MB1870 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5049 Lines: 178 They may be accessed from low-level code, so isolating is a measure to avoid circular dependencies in header files. The exact reason for circular dependency is WARN_ON() macro added in patch edd63a27 "set_restore_sigmask() is never called without SIGPENDING (and never should be)" Signed-off-by: Yury Norov --- include/linux/thread_bits.h | 63 +++++++++++++++++++++++++++++++++++++++++++ include/linux/thread_info.h | 65 +++++++++------------------------------------ 2 files changed, 75 insertions(+), 53 deletions(-) create mode 100644 include/linux/thread_bits.h diff --git a/include/linux/thread_bits.h b/include/linux/thread_bits.h new file mode 100644 index 000000000000..87354331bc7b --- /dev/null +++ b/include/linux/thread_bits.h @@ -0,0 +1,63 @@ +/* thread_bits.h: common low-level thread bits accessors */ + +#ifndef _LINUX_THREAD_BITS_H +#define _LINUX_THREAD_BITS_H + +#ifndef __ASSEMBLY__ + +#include +#include + +#ifdef CONFIG_THREAD_INFO_IN_TASK +/* + * For CONFIG_THREAD_INFO_IN_TASK kernels we need for the + * definition of current, but for !CONFIG_THREAD_INFO_IN_TASK kernels, + * including can cause a circular dependency on some platforms. + */ +#include +#define current_thread_info() ((struct thread_info *)current) +#endif + +/* + * flag set/clear/test wrappers + * - pass TIF_xxxx constants to these functions + */ + +static inline void set_ti_thread_flag(struct thread_info *ti, int flag) +{ + set_bit(flag, (unsigned long *)&ti->flags); +} + +static inline void clear_ti_thread_flag(struct thread_info *ti, int flag) +{ + clear_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_and_set_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_and_clear_bit(flag, (unsigned long *)&ti->flags); +} + +static inline int test_ti_thread_flag(struct thread_info *ti, int flag) +{ + return test_bit(flag, (unsigned long *)&ti->flags); +} + +#define set_thread_flag(flag) \ + set_ti_thread_flag(current_thread_info(), flag) +#define clear_thread_flag(flag) \ + clear_ti_thread_flag(current_thread_info(), flag) +#define test_and_set_thread_flag(flag) \ + test_and_set_ti_thread_flag(current_thread_info(), flag) +#define test_and_clear_thread_flag(flag) \ + test_and_clear_ti_thread_flag(current_thread_info(), flag) +#define test_thread_flag(flag) \ + test_ti_thread_flag(current_thread_info(), flag) + +#endif /* !__ASSEMBLY__ */ +#endif /* _LINUX_THREAD_BITS_H */ diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index d7d3ea637dd0..c40a89357329 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -7,9 +7,21 @@ #ifndef _LINUX_THREAD_INFO_H #define _LINUX_THREAD_INFO_H +/* + * For per-arch arch_within_stack_frames() implementations, defined in + * asm/thread_info.h. + */ +enum { + BAD_STACK = -1, + NOT_STACK = 0, + GOOD_FRAME, + GOOD_STACK, +}; + #include #include #include +#include #ifdef CONFIG_THREAD_INFO_IN_TASK /* @@ -22,18 +34,6 @@ #endif #include - -/* - * For per-arch arch_within_stack_frames() implementations, defined in - * asm/thread_info.h. - */ -enum { - BAD_STACK = -1, - NOT_STACK = 0, - GOOD_FRAME, - GOOD_STACK, -}; - #include #ifdef __KERNEL__ @@ -45,47 +45,6 @@ enum { # define THREADINFO_GFP (GFP_KERNEL_ACCOUNT | __GFP_NOTRACK) #endif -/* - * flag set/clear/test wrappers - * - pass TIF_xxxx constants to these functions - */ - -static inline void set_ti_thread_flag(struct thread_info *ti, int flag) -{ - set_bit(flag, (unsigned long *)&ti->flags); -} - -static inline void clear_ti_thread_flag(struct thread_info *ti, int flag) -{ - clear_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_and_set_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_and_set_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_and_clear_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_and_clear_bit(flag, (unsigned long *)&ti->flags); -} - -static inline int test_ti_thread_flag(struct thread_info *ti, int flag) -{ - return test_bit(flag, (unsigned long *)&ti->flags); -} - -#define set_thread_flag(flag) \ - set_ti_thread_flag(current_thread_info(), flag) -#define clear_thread_flag(flag) \ - clear_ti_thread_flag(current_thread_info(), flag) -#define test_and_set_thread_flag(flag) \ - test_and_set_ti_thread_flag(current_thread_info(), flag) -#define test_and_clear_thread_flag(flag) \ - test_and_clear_ti_thread_flag(current_thread_info(), flag) -#define test_thread_flag(flag) \ - test_ti_thread_flag(current_thread_info(), flag) - #define tif_need_resched() test_thread_flag(TIF_NEED_RESCHED) #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES -- 2.11.0