From patchwork Mon Mar 9 19:47:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 213175 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 9FFA6C10F29 for ; Mon, 9 Mar 2020 19:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79B1924654 for ; Mon, 9 Mar 2020 19:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783326; bh=t5E4LYaQi3hLF0ZQnDleGqngq0///iKC3muWnbwhvos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=ErSCZwwSZYS2hAY3Izu8evEFOkpAAOVBmdN4O4bY1Vf6fNe0frz3z42NUQzMLgDcS VhmVs/O2+D0heqP8d1rHQ+Ou/PxGL5wMZIsb5Sh7kE4MiU93y2kstAmpYHJkXYGEbB 6MO9Bv7NuOFx5VKaQKgoky+CoLUIXyFFDDtoviaI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbgCITsm (ORCPT ); Mon, 9 Mar 2020 15:48:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:38280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbgCITsS (ORCPT ); Mon, 9 Mar 2020 15:48:18 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0ED124676; Mon, 9 Mar 2020 19:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783297; bh=t5E4LYaQi3hLF0ZQnDleGqngq0///iKC3muWnbwhvos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=G9pFhIVSforCc9xPpZFfoKmL0cEmzc1qDZ6RmU/cCg85aAsvHSeLjn3jTCGrx8SnH vZpUjOFYkdDfsus9ROEJvg3v4+z9wR9JKgHM3C0d/UVwj19esUYY0WAPxgVNgrn54H My8oK5vREsjuTtnX/SlnhJWORuaGDJ9eiRiMVc9o= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi Cc: Scott Wood Subject: [PATCH RT 3/8] sched: migrate_enable: Remove __schedule() call Date: Mon, 9 Mar 2020 14:47:48 -0500 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Scott Wood v4.14.172-rt78-rc1 stable review patch. If anyone has any objections, please let me know. ----------- [ Upstream commit b8162e61e9a33bd1de6452eb838fbf50a93ddd9a ] We can rely on preempt_enable() to schedule. Besides simplifying the code, this potentially allows sequences such as the following to be permitted: migrate_disable(); preempt_disable(); migrate_enable(); preempt_enable(); Suggested-by: Sebastian Andrzej Siewior Signed-off-by: Scott Wood Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tom Zanussi Conflicts: kernel/sched/core.c --- kernel/sched/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 960daa6bc7f04..3ff48df25cff8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7024,7 +7024,6 @@ void migrate_enable(void) stop_one_cpu_nowait(task_cpu(p), migration_cpu_stop, arg, work); tlb_migrate_finish(p->mm); - __schedule(true); } out: From patchwork Mon Mar 9 19:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 213178 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, 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 B91BEC10F27 for ; Mon, 9 Mar 2020 19:48:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 986072467D for ; Mon, 9 Mar 2020 19:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783301; bh=lsMfP3k9nqqOalUYsdvpoPo/rDyn6TAlb80enEyNUoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=BqUfeDv9IVBsmNOpuNXQ7a1lvMFVP4jC0SFhuB9uUzkDvmZwYz/5/uqGrXKArriXK 1mn7R4mrbA6MzZeta7cnnQdBRyK1mkviBZbM/mVOM9crZx0/gw1FuhC9L0wnjUwy5v 1UL2IQUhtZt+wl1iaHkNof4kqXybjmgTkstEiKYo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgCITsU (ORCPT ); Mon, 9 Mar 2020 15:48:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:38294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbgCITsT (ORCPT ); Mon, 9 Mar 2020 15:48:19 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1BA742465A; Mon, 9 Mar 2020 19:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783298; bh=lsMfP3k9nqqOalUYsdvpoPo/rDyn6TAlb80enEyNUoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=n6Y2l5ThdUW1TT2tyZooM+zBtPKplMlOY/1Di9xgtM2W0zRt4htjUAZRcvw9bkrHd ULmbmZcnZspko55eTUN6exkXwpmV4i8HqjpL1kYggAMxKbeWOsnPAuwXO5uhqdAgTH zIImgJmaLVhpty9qaqnKo1kUnvW/jIWNeXkSF6tE= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi Cc: Matt Fleming Subject: [PATCH RT 4/8] mm/memcontrol: Move misplaced local_unlock_irqrestore() Date: Mon, 9 Mar 2020 14:47:49 -0500 Message-Id: <41b2fe158cc09157964879dce19e74e1de962f27.1583783251.git.zanussi@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Matt Fleming v4.14.172-rt78-rc1 stable review patch. If anyone has any objections, please let me know. ----------- [ Upstream commit 071a1d6a6e14d0dec240a8c67b425140d7f92f6a ] The comment about local_lock_irqsave() mentions just the counters and css_put_many()'s callback just invokes a worker so it is safe to move the unlock function after memcg_check_events() so css_put_many() can be invoked without the lock acquired. Cc: Daniel Wagner Signed-off-by: Matt Fleming [bigeasy: rewrote the patch description] Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tom Zanussi --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0503b31e2a873..a359a24ebd9f0 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6102,10 +6102,10 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) mem_cgroup_charge_statistics(memcg, page, PageTransHuge(page), -nr_entries); memcg_check_events(memcg, page); + local_unlock_irqrestore(event_lock, flags); if (!mem_cgroup_is_root(memcg)) css_put_many(&memcg->css, nr_entries); - local_unlock_irqrestore(event_lock, flags); } /** From patchwork Mon Mar 9 19:47:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 213176 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 0F110C10F27 for ; Mon, 9 Mar 2020 19:48:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5C0524680 for ; Mon, 9 Mar 2020 19:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783319; bh=jk7Pvpx0sd6QCQwzSvQUmXSsA5DYpbI+9cKslUmsgnw=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=Mk4cVF8AfQDd88PBdpEqz+aHT/lMfsDs6m2lfwzP9o6dDaz643MqvU40utwEvp4TI GRUPqR/vVOQXsWysbcLfhu0BDoodObGj5JLNr/kixaWcoMLPCCoJBgU5q8waljVlPJ UFwtJiL9Ey8OAb3tyGSET18ZeIXfX4eWMi3SffOM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbgCITsU (ORCPT ); Mon, 9 Mar 2020 15:48:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:38314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbgCITsU (ORCPT ); Mon, 9 Mar 2020 15:48:20 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 22A6424673; Mon, 9 Mar 2020 19:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783299; bh=jk7Pvpx0sd6QCQwzSvQUmXSsA5DYpbI+9cKslUmsgnw=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=EjSwCduPsfpPDGQ3IJIy1A7IYqdC8nbDqNFqAkmf6lqW7iS4EBhtXArFa0zWAQ+q1 aajLPPBZa9wqSMVf7iEC8mzEsESrQ193C0yfA2OLeo4jrO+6J7ItGt1y67n0UhiwLw V8hKBvAKiRXSCrIuslcUpY7U4gR0W127sKUl01MY= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi Subject: [PATCH RT 5/8] locallock: Include header for the `current' macro Date: Mon, 9 Mar 2020 14:47:50 -0500 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Sebastian Andrzej Siewior v4.14.172-rt78-rc1 stable review patch. If anyone has any objections, please let me know. ----------- [ Upstream commit e693075a5fd852043fa8d2b0467e078d9e5cb782 ] Include the header for `current' macro so that CONFIG_KERNEL_HEADER_TEST=y passes. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tom Zanussi --- include/linux/locallock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/locallock.h b/include/linux/locallock.h index 921eab83cd34a..81c89d87723b5 100644 --- a/include/linux/locallock.h +++ b/include/linux/locallock.h @@ -3,6 +3,7 @@ #include #include +#include #ifdef CONFIG_PREEMPT_RT_BASE From patchwork Mon Mar 9 19:47:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Zanussi X-Patchwork-Id: 213177 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, 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 708FAC10F25 for ; Mon, 9 Mar 2020 19:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4951524679 for ; Mon, 9 Mar 2020 19:48:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783312; bh=j9EFBRUeGEgaJou7VzJyPRqtYH74YJhWOcl/Fg2SBEc=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:List-ID:From; b=ZbRMFS9x5WY/hniQ0y05lOLA2gLwfcYJ00X0uKLLbIqinJMsCL33sQznnDiQqUiHH hWnMLt+YMwhF6axLGqHik5SG6Ou8x7D2mil6NfI4BwxTnFdctySqhq+4ueFUgdBR3f zKgChQ3xaxmQsMWKw+08pgRnOgh267ShBgx0AhEs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbgCITsb (ORCPT ); Mon, 9 Mar 2020 15:48:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:38322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgCITsV (ORCPT ); Mon, 9 Mar 2020 15:48:21 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2891024677; Mon, 9 Mar 2020 19:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583783300; bh=j9EFBRUeGEgaJou7VzJyPRqtYH74YJhWOcl/Fg2SBEc=; h=From:To:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=N76Iv7B7LuNwOci4o5wYZZxDF9JgCRR1cIZi+Ds659KD/vHryPrcf/0tAyu8nu0Ze BVfnOmuEmjzAPzAHUmYaL3qUSdkILHqs5YFKpYS9oc3qZI/qGm28fDzveS68lvR8vv xnBiTSLAFYOrCt9VIUZ+h2Q+8/StGW05GKFnkuis= From: zanussi@kernel.org To: LKML , linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi Subject: [PATCH RT 6/8] drm/vmwgfx: Drop preempt_disable() in vmw_fifo_ping_host() Date: Mon, 9 Mar 2020 14:47:51 -0500 Message-Id: <7b50a4187b38dd305b91907c235c2382cc87bca1.1583783251.git.zanussi@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Sebastian Andrzej Siewior v4.14.172-rt78-rc1 stable review patch. If anyone has any objections, please let me know. ----------- [ Upstream commit b901491e7b9b7a676818d84e482b69be72fc142f ] vmw_fifo_ping_host() disables preemption around a test and a register write via vmw_write(). The write function acquires a spinlock_t typed lock which is not allowed in a preempt_disable()ed section on PREEMPT_RT. This has been reported in the bugzilla. It has been explained by Thomas Hellstrom that this preempt_disable()ed section is not required for correctness. Remove the preempt_disable() section. Link: https://bugzilla.kernel.org/show_bug.cgi?id=206591 Link: https://lkml.kernel.org/r/0b5e1c65d89951de993deab06d1d197b40fd67aa.camel@vmware.com Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Tom Zanussi --- drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c index a1c68e6a689e3..713f202fca2cd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c @@ -167,10 +167,8 @@ void vmw_fifo_ping_host(struct vmw_private *dev_priv, uint32_t reason) { u32 *fifo_mem = dev_priv->mmio_virt; - preempt_disable(); if (cmpxchg(fifo_mem + SVGA_FIFO_BUSY, 0, 1) == 0) vmw_write(dev_priv, SVGA_REG_SYNC, reason); - preempt_enable(); } void vmw_fifo_release(struct vmw_private *dev_priv, struct vmw_fifo_state *fifo)