From patchwork Mon Jan 9 11:29:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9504425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74D6C6071A for ; Mon, 9 Jan 2017 11:32:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 711C428365 for ; Mon, 9 Jan 2017 11:32:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6432D283F3; Mon, 9 Jan 2017 11:32:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E97C928365 for ; Mon, 9 Jan 2017 11:32:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQYC2-0004Ay-5i; Mon, 09 Jan 2017 11:32:50 +0000 Received: from mail-by2nam01on0065.outbound.protection.outlook.com ([104.47.34.65] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQYBv-0003bn-JU for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 11:32:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-caviumnetworks-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A1jkIVJJVHsYGAVR5w/Y8Pn5ReplGwW/2LrL3ExVzsU=; b=cVPlM18MuCqhxZc116RiuWDkhdSJqjEoQwo8o7NAzqXg3cPIsM5lzkGYIm9mA2JhELd5sKXu/5QSCl6EoMiHEvBqHVxGxBDjApq/emRFNUNrZnce13sVt9UvMqbIwHz2BUNANK+ztEhaJy7I5P0phY49cCDQC4NqPpDa2M1hbBk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@caviumnetworks.com; Received: from localhost (103.78.20.242) by BN4PR07MB2241.namprd07.prod.outlook.com (10.164.63.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Mon, 9 Jan 2017 11:32:19 +0000 From: Yury Norov To: , , , "linux-arch @ vger . kernel . org Arnd Bergmann" , Catalin Marinas Subject: [PATCH 08/20] thread: move thread bits accessors to separated file Date: Mon, 9 Jan 2017 16:59:45 +0530 Message-ID: <1483961397-8599-9-git-send-email-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> References: <1483961397-8599-1-git-send-email-ynorov@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [103.78.20.242] X-ClientProxiedBy: AM4PR02CA0004.eurprd02.prod.outlook.com (10.165.239.142) To BN4PR07MB2241.namprd07.prod.outlook.com (10.164.63.147) X-MS-Office365-Filtering-Correlation-Id: c97ad8f9-1246-4662-0b3a-08d438832c41 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN4PR07MB2241; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 3:GeE918V9Kisz9CqSVxd6zbCTrLoA5C6zQkO/7TpyKfMM39G21DTMfJ9Q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ue1dI= X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 31:zlv2nc4snCOJy1y0QliZeLLPCaOxrb3C+xg0uCfcJqHDEZGqtvBRBm5EUcpmp0kAotMqYzo1JCQFpEvPgm6EVVvUnDfOBzD+ITTU26yk6lRecrT41t4AcbbjcVNzfhrZbsCgkiwBSWJfF3MG2ko5B8j3iEjXmfxfBtfQMzxr5pXKhh5aYsztkJG19pFWY4iOPjnxv+U6V1GKqdVbqzSDun0n0V/Q5H2QjSq3gnMpEPls5oADXp5KbT9xL0SD5HHM; 20:G+5ldrUIg/i70SjIeuJZG06Ll2AeUQkwwy7npdxvM39bhRTW+Mlrmv8vChhtcY4FK46UbCGWiMrH/UP2Mlb17HisCWlNRAuUfqT81Nu25uttolKjlx1KAXd7Bd9oCoh0A0StsNn2AwaT8qJTYaVmykTJFRuftPbnSS4Bj5ATslTUHwoOTapXbq7Q1mc43bUMTrHXvvi+UUzYgcXGQamouk+NHg9LcBfqwyg9Qe/wkCGRmjef0aD6Nnw/6gM29VUQ7qVw7q+OmWPYCxmddh+U8vPuMKO2YI4tPFfPm0mBLZPSj7Cfni8RvUGdfdthEkQEPTEVVDNPx6dsj8vml4HDy/kiUaAUkKaP9AgayvBXgF2xI1m9gVIRKYWj8Tv/eCPjJAH50F/Vm79vlisFuZm/Nlwih0RsiddfeaPgPHDF8bbVZIRXq0WchGwXrVljAgz58j7z9WQ+I2ihQg2NQrDHaUw3i7ES7BMYiFCuEkw0R5gknZoSewoB6kkv2ifyp6UyTtMa8mreLo0P00I36DnHR7IOCUoBBi+qqMfnLusahIRCZjus8wNdciaGDTBwQ6dpZYxEmGU4ADF7trBJwFsDk1PacGs4AxU3S5R3naFZx1w= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BN4PR07MB2241; BCL:0; PCL:0; RULEID:; SRVR:BN4PR07MB2241; X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 4:BQ5lJ7+Bgm0/E4pSfCDrrNPp1g16TcqKIEczYCvPZVTSeva9Dn8vFNQLOXGFB0iuevia+9udEgX/BuR2PY/MYpftgOrjJw+k1wdV7opvlDW3ayfCA8NrJvQTxO+/ibOcK9lybSYeQxCEJ1b8hPL/kD6tR/2Kw2gilsh5afNQBOCeQ2DYZGq1MGHV5bPOFuJtoapjyaB693Ou2lsRa6XW5qCE5KzDxrbplAdz2qcfwOyWzdCr9pl6XM7OSvjPAmB6p1wDis5TLEBy5utLj/M9y5PDk/b7vWQd6TIYR7Q1veaBrVj0NlrGdS//vgcH+43/EaG/exQ+vvF963MkC7+hnPb6qdwntHkXYMNKumm08WVbdMkF6Ta1gtbQ11pRk/MrjCcq7VGmo7x9JHo5pZUZt4D4Kpvyy14Q4pp0OjAvRYW73TYA6NafaNknW4tlWE7CYTwEPdSmwlDh96hJyc8EZEAMpwuGO3MDDZHiD/oeTVaQ5tdZde+Bycx2uZW2qseLQ09Obj3d1Sso90w3ZWiA9D7qFAg6mc8v2mspLjCYktqKUMMGtsBqVVRBTgpoOBvG X-Forefront-PRVS: 0182DBBB05 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(42186005)(48376002)(101416001)(105586002)(76176999)(106356001)(50466002)(50986999)(47776003)(66066001)(36756003)(5001770100001)(97736004)(76506005)(92566002)(8676002)(7416002)(81166006)(81156014)(50226002)(5003940100001)(189998001)(4326007)(33646002)(68736007)(305945005)(2906002)(7736002)(2950100002)(6496003)(6486002)(6666003)(39060400001)(38730400001)(3846002)(5660300001)(6116002)(25786008)(2201001)(54906002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR07MB2241; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR07MB2241; 23:vfJHsgDRPj+A2aq4ss9f12u3ECjZAoXLQHJYplXIu?= =?us-ascii?Q?sySx6dlPE4chKgpBEk3bRujY+eY7RTTcuylkncjeiJmmtneOmWti5Aq2kx5q?= =?us-ascii?Q?mrRBqPdFE+MdqUXb0r5VpgHBdPird8X7h3cvPj0RrAiSUMfkHAM9qmnpWMYV?= =?us-ascii?Q?clzTNDeoHXym6ocPluL1PKq7j/vjIskwqTMZsULqGPv/EmEdf/W9htDUD8b1?= =?us-ascii?Q?mw/xPJZhncu8lKg425xIPuL6kGwndPTHnDMVYNIytSMtK+cA3gxmbkx4LKXx?= =?us-ascii?Q?Nf0Qv9m38v0L8NcQTuqBs1DC5a8yo04fHNXzdibSTLloNpG8UNdR582yQvwS?= =?us-ascii?Q?FCC/3M3GticNLtl75ZDzJtaMIGxzglDytn2NixjFCF0OiDM1NujXBjL5tQBr?= =?us-ascii?Q?UZxCbOLM/p2B4+zD0NAwtXWD6kAz1wEn+yNkvdck8PK81Q1cBUvbnQbez0m7?= =?us-ascii?Q?K5cAomUARPCImcg32aWtImlSwXdoNKt/oabBGpp2vzRUBJDed/vloP6EVMLZ?= =?us-ascii?Q?0k1PnGu8trVGDLN7UGmDj9Ye52Ib8qVggiw1bkebTi49zWV0L5D1e0wZkXTh?= =?us-ascii?Q?bvHYZSiFM4zZR31bp32BhwB4e9Gx82j3ik+pHWvWAkXEnwhu5FxRCn5+6Ak1?= =?us-ascii?Q?cjPpV+MlvnOMQ/NT0dF1pYdmRtSnz8soZM8aKDH59EGwWNqLYNfOZrqhd9cQ?= =?us-ascii?Q?t7Q01RrkPKztgvxc+K8LznOYPA5Kr0dLtN0FeTGYNM61eu0fqn40zjxWW9M/?= =?us-ascii?Q?HMQR8TD1ds+HQrA01GNdlCHgDWHn2jJKHA8uOoD6C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A==; 24:OuIcgKGqpt99EvfETC6gqc+CqQdLYVD1jHx7GIWu3RXBjXY2/G4CLUVk/ssXpuIFNfh/kC3lS3M8v4Ir38xOE/JErvIETmnG5xAqRmIes7o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR07MB2241; 7:iop2ozBQrKtEvVo1QnVLXgBFJt+kbnvseeIQeUbRlSaejAqxZRjalzij5RlLgUtaS2Tw0hSMWd+mcpoltYAzGYOx+yp+PNTlAdO/G6vyED+XC1nruaQenP5tFef8GaG2Mw6qSAZ/GmLG2413KeVKZZT8HlC4a1x3mbvrD/XHYeL+Zeq1r19RL+bEAnAJx8Eb9T2ZxgtAmXDUsIQcSwrwGXeBuIXHI2DQ4sBb3VkhtDSEf1o5v6lRe6bFuFWvxNqZ1pgkxTpjovcpsx5/91K5+k+/Ndpa0+33LpKIQHAK955Ef43KjTjSHwN3Z+HdN3oMeEu2m4ScLRq6Sx5AfhAvrjHVbBwmkc2OvVyP6i1e17m8Q/OhyXwLl1E4EL23qp7Img+6HoqqXtHhSuP5hd+8jzU3kh6jBlgbRElpi2pqdqj0bKYxyzFLQvp7xD9aELiuUinSxp961beIUsskVloBsA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2017 11:32:19.1867 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR07MB2241 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_033243_994550_3B3E4E61 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Pinski , Heiko Carstens , Chris Metcalf , Yury Norov , philipp.tomsich@theobroma-systems.com, Joseph Myers , zhouchengming1@huawei.com, Steve Ellcey , Prasun.Kapoor@caviumnetworks.com, Andreas Schwab , agraf@suse.de, szabolcs.nagy@arm.com, geert@linux-m68k.org, Adam Borowski , manuel.montezelo@gmail.com, Chris Metcalf , Andrew Pinski , linyongting@huawei.com, klimov.linux@gmail.com, broonie@kernel.org, Bamvor Zhangjian , Maxim Kuvyrkov , Florian Weimer , Nathan_Lynch@mentor.com, Ramana Radhakrishnan , schwidefsky@de.ibm.com, davem@davemloft.net, christoph.muellner@theobroma-systems.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 | 54 +------------------------------------- 2 files changed, 64 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 0000000..8735433 --- /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 5837387..a325deb 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h @@ -11,18 +11,7 @@ #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 - -#include -#include +#include #ifdef __KERNEL__ @@ -33,47 +22,6 @@ # 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