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); } /**