Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3487428ybz; Mon, 27 Apr 2020 16:59:07 -0700 (PDT) X-Google-Smtp-Source: APiQypIILX7+aI80ZmfO7Yvq4GmU7WPg1qVFQNqv5veplb9TTSyvHhNu5/7THFq6njcyCVt7uuPO X-Received: by 2002:a17:906:f13:: with SMTP id z19mr9169020eji.380.1588031947136; Mon, 27 Apr 2020 16:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588031947; cv=none; d=google.com; s=arc-20160816; b=x4fjdAXZ21x2n81dwuQs61X6B9KAaLVPDaFraXyRY9sTayvDcXy8tbKWExJ4zSgkRB 6EZgr1LTxcmCD3CzajSz344TXQ6vQ/rh3xG5t8urLbS5oqkC4N9Gi2CAne10xFytjGhd KJxi/IrzTQ6pQhmsGWCkN4AjX+53KC/h7De6qj5b8fNlvNdYJshOQqBFnjaobDD+uYrC qzj5m67hr0VUseLkdMu/LLotOXl1BFda4YCdox5YHisziKjzUQ/ZZ7aFac33SjzKRLvO x7m1qG62CZUlwwf4Fxyt93YH6i+k+8hIwhSPA87OsX8mvxXRV89oMhaUyH/LRAXXmCMA W5+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=xqSYkkiN5zo6A8A9R6SrdTZLgFG5Vtd3h0pL6NAIaDM=; b=dCKITUSVxY1SeVFu7G7uJARct1pMVYd9WVVddCh7W9oGc8OOa51ovvMBKMzWdK5K3O QdpNwW9Hx8HMzy18TZ1k33/IUllgkPYcw/8v1+lZ9UmVHXY0ImEWgoBEzYjibnhFIBJE 2+5hFf1HLcZk7znP4b55P4/sA12bmWjGjadX8b/0RBNMvQtMlOX5Z0SsjP7qcsxxqrK3 DZ3Nq3BT0UVgeaqFg0K7uYz58yJLgjPZ313aKkh4DRsoMZhVSEWwotaBhSY7LTOHN4ra jTeOmAgLxYELv5INiGbyseoTHa65iZNBE9tNvHed6VwbcyeE3ciYpvYqXTro2cb97jaU r45w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fgb9lB1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si708161edn.251.2020.04.27.16.58.44; Mon, 27 Apr 2020 16:59:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fgb9lB1Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726375AbgD0X4t (ORCPT + 99 others); Mon, 27 Apr 2020 19:56:49 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:60628 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726253AbgD0X4t (ORCPT ); Mon, 27 Apr 2020 19:56:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588031808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=xqSYkkiN5zo6A8A9R6SrdTZLgFG5Vtd3h0pL6NAIaDM=; b=fgb9lB1QQNEMwkcUFnXDzgRvoRAfWRK/iBUfLwBhGt3j5X6xnfvCop8JS6A7+C5vkvfyfe HMh4jtH9av+fLOj0VdGBe7xtpvVhDeearTgP78q+wg+HsybkT/snufRIy5NPtHiitcP3aR xFIcIKJKn4P3xbvo/eoXtbUoqIpDXCI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-YS63Xv_VM8-Rn4F-pZDCCA-1; Mon, 27 Apr 2020 19:56:44 -0400 X-MC-Unique: YS63Xv_VM8-Rn4F-pZDCCA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1BEC6107ACCA; Mon, 27 Apr 2020 23:56:42 +0000 (UTC) Received: from llong.com (ovpn-112-176.rdu2.redhat.com [10.10.112.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56F7760BE2; Mon, 27 Apr 2020 23:56:33 +0000 (UTC) From: Waiman Long To: Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Johannes Weiner , Michal Hocko , Vladimir Davydov Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Juri Lelli , Qian Cai , Waiman Long Subject: [PATCH v2 0/4] mm/slub: Fix sysfs circular locking dependency Date: Mon, 27 Apr 2020 19:56:17 -0400 Message-Id: <20200427235621.7823-1-longman@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2: - Use regular cmpxchg() instead of x86-only try_cmpxchg() in patch 2. - Add patches 3 and 4 to fix circular locking dependency showing up at shutdown time. With lockdep enabled, issuing the following command to the slub sysfs files will cause splat about circular locking dependency to show up either immediately afterwards or at shutdown time. # echo 1 > validate # echo 1 > shrink This patchset fixes these lockdep splats by replacing slab_mutex with memcg_cache_ids_sem as well as changing some of the lock operations with trylock. Waiman Long (4): mm, slab: Revert "extend slab/shrink to shrink all memcg caches" mm/slub: Fix slab_mutex circular locking problem in slab_attr_store() mm/slub: Fix another circular locking dependency in slab_attr_store() mm/slub: Fix sysfs shrink circular locking dependency include/linux/memcontrol.h | 1 + include/linux/memory_hotplug.h | 2 + mm/memcontrol.c | 5 ++ mm/memory_hotplug.c | 5 ++ mm/slab.h | 1 - mm/slab_common.c | 37 ------------- mm/slub.c | 98 +++++++++++++++++++++++++++++----- 7 files changed, 99 insertions(+), 50 deletions(-) -- 2.18.1