Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3711722ybv; Mon, 10 Feb 2020 05:08:56 -0800 (PST) X-Google-Smtp-Source: APXvYqzknFUl3WT6f9dg5LDm6ZI1h7cwFZzUDJPm1E5Mz3sA3g5+M2xsyR5HTGWH9L/7+HsE/Rv6 X-Received: by 2002:a05:6808:611:: with SMTP id y17mr729136oih.146.1581340136615; Mon, 10 Feb 2020 05:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340136; cv=none; d=google.com; s=arc-20160816; b=A7q7fxi9wXbz5Eak4B3mElr+hb1EsLB34ayIDSLsSfcemAKt1zjbYAyHtyxpsrTqbn MOwx9fgfTK6Ho4GwDxwr5+L6Jczw2tg4IP/nmZ4gNfWvndOXz2DmsUs2F8D3e2CXQioF 8ZQPTw5/FSJjDmWSUrYlRyFlsAF7EXDS7NcOg0jNSsr1Piz/9o/D59xPaCV4UAIiUOxc VFYf3KNCQABglM1FAIXV4pHfwxFuEGonKZ/semboS+Bsrjmejp+XqFfNYhsk8BE63K48 QENEr4azg2i/ccfI0+hymoKDvl34aOq9m8LO6J9sefb8qiNFnakq31XbjWJlw+kDiesh /Zeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zo207rwfX4HmMS/58mQByCfURiZJDoN/NPT42dVBuHw=; b=pcI+596FK6HOTb0v3Ble9VQD0V2ZqJBuMYQOO2Gjpq24h/QJYrk+H51lupUgJS7AFJ gBMx81Ho7dpTnIUA6JMgZUPcEKR4NcozOTdrxFlfAgVsAUEJIYFGSbFwG6heTKEBoA+D JQNWXCxCU/a6e0j/0FF3eXzzEq5n1kZOLzWudh1ygR/Wgzx6dKv15ndphMq1sRM5ptpg rJ3kdWRnk8oxfnrhC/Jg9AiJUopoHqXV2wKmhHml8vTTNClz6YuTRuLCE5UpizssLBkB R2uHlUHTB1yNm9ltGmWpS0vToegVIY+KxrdXhRFjBPGYkQ0mTj7dekAMmlM7ALvwsxZC xk2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bnCRDm/H"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si133359oik.171.2020.02.10.05.08.44; Mon, 10 Feb 2020 05:08:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bnCRDm/H"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730644AbgBJNHg (ORCPT + 99 others); Mon, 10 Feb 2020 08:07:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:37990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729484AbgBJMjl (ORCPT ); Mon, 10 Feb 2020 07:39:41 -0500 Received: from localhost (unknown [209.37.97.194]) (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 83CA82080C; Mon, 10 Feb 2020 12:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338380; bh=nS/T19tB9hCNwW58WPAY8a5xA4txGj26jRhIMXkDoDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnCRDm/HoILlGXAzxxUrPN6fU7EAPoBIX3AmkiOJZvCgxe1nOBq2DDIWBbR6GcqZr 3a+Ohdf2mMovzy9Nmh5EzVFkrl/AT8epbX3NmLR5gJGEBIqrVMA82cdzveKlmw7nII QB+axBMhIiyr06DU1KnkY+3r8u/cLEtlx8ShYICE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yang , "Kirill A. Shutemov" , Yang Shi , David Rientjes , Michal Hocko , Johannes Weiner , Vladimir Davydov , Andrew Morton , Linus Torvalds Subject: [PATCH 5.5 059/367] mm: thp: dont need care deferred split queue in memcg charge move path Date: Mon, 10 Feb 2020 04:29:32 -0800 Message-Id: <20200210122429.535122148@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@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: Wei Yang commit fac0516b5534897bf4c4a88daa06a8cfa5611b23 upstream. If compound is true, this means it is a PMD mapped THP. Which implies the page is not linked to any defer list. So the first code chunk will not be executed. Also with this reason, it would not be proper to add this page to a defer list. So the second code chunk is not correct. Based on this, we should remove the defer list related code. [yang.shi@linux.alibaba.com: better patch title] Link: http://lkml.kernel.org/r/20200117233836.3434-1-richardw.yang@linux.intel.com Fixes: 87eaceb3faa5 ("mm: thp: make deferred split shrinker memcg aware") Signed-off-by: Wei Yang Suggested-by: Kirill A. Shutemov Acked-by: Yang Shi Cc: David Rientjes Cc: Michal Hocko Cc: Kirill A. Shutemov Cc: Johannes Weiner Cc: Vladimir Davydov Cc: [5.4+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/memcontrol.c | 18 ------------------ 1 file changed, 18 deletions(-) --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5340,14 +5340,6 @@ static int mem_cgroup_move_account(struc __mod_lruvec_state(to_vec, NR_WRITEBACK, nr_pages); } -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (compound && !list_empty(page_deferred_list(page))) { - spin_lock(&from->deferred_split_queue.split_queue_lock); - list_del_init(page_deferred_list(page)); - from->deferred_split_queue.split_queue_len--; - spin_unlock(&from->deferred_split_queue.split_queue_lock); - } -#endif /* * It is safe to change page->mem_cgroup here because the page * is referenced, charged, and isolated - we can't race with @@ -5357,16 +5349,6 @@ static int mem_cgroup_move_account(struc /* caller should have done css_get */ page->mem_cgroup = to; -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - if (compound && list_empty(page_deferred_list(page))) { - spin_lock(&to->deferred_split_queue.split_queue_lock); - list_add_tail(page_deferred_list(page), - &to->deferred_split_queue.split_queue); - to->deferred_split_queue.split_queue_len++; - spin_unlock(&to->deferred_split_queue.split_queue_lock); - } -#endif - spin_unlock_irqrestore(&from->move_lock, flags); ret = 0;