Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbdGZRCV (ORCPT ); Wed, 26 Jul 2017 13:02:21 -0400 Received: from resqmta-ch2-03v.sys.comcast.net ([69.252.207.35]:45286 "EHLO resqmta-ch2-03v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbdGZRCT (ORCPT ); Wed, 26 Jul 2017 13:02:19 -0400 Date: Wed, 26 Jul 2017 12:02:17 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Dima Zavin cc: Mel Gorman , Andrew Morton , Li Zefan , Pekka Enberg , David Rientjes , Joonsoo Kim , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Cliff Spradlin Subject: Re: [RFC PATCH] mm/slub: fix a deadlock due to incomplete patching of cpusets_enabled() In-Reply-To: <20170726165022.10326-1-dmitriyz@waymo.com> Message-ID: References: <20170726165022.10326-1-dmitriyz@waymo.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfKHYmQkGfS6jm4W45IEVNHMvf8JSg7FmKuGBYXCzjIJYo8rgNkcyqxcVRaAYIHxxkQCRr0MdGEFuXVQc+89cAPfuGlT8+dDwtBli95PmQ7P/vqN+b+5w rCBYo3meQdEhtcADhTOg97Up2we8djZ1KsHzhS5xPYHtwOuVZ0n25D0j5Z2e1gfhrIuKtiq6SqSuWy43ggqkolCnNToFGaCJYrQeHcebkt6WJdsnR6WE1TCV 182A/ucNr9OOBng3fIh78oZrqZQ/hxVxZeYL3vzW/qwLiQnNSPgLExlT6YvjtquO2TxnejRo1vCQf6v2goanwOISQDKRX5huLOYgA218Yp1Pok9lbrMPzEky oWAI4OVHq0ftLM47v4vN2JhFbNMEc/wRScpNx8X+PyTQFvt/9K3dASFjRmEDvwNM/slp8VkbV5yEP7EqfLSt07QKi4OIVTWXgL35aSw/kHmycqcRH6WCeMEA O5noMM9W05oTshIu Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 520 Lines: 12 On Wed, 26 Jul 2017, Dima Zavin wrote: > The fix is to cache the value that's returned by cpusets_enabled() at the > top of the loop, and only operate on the seqlock (both begin and retry) if > it was true. I think the proper fix would be to ensure that the calls to read_mems_allowed_{begin,retry} cannot cause the deadlock. Otherwise you have to fix this in multiple places. Maybe read_mems_allowed_* can do some form of synchronization or *_retry can implictly rely on the results of cpusets_enabled() by *_begin?