From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752366AbaEUOp6 (ORCPT ); Wed, 21 May 2014 10:45:58 -0400 Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56]:59296 "EHLO qmta06.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbaEUOp5 (ORCPT ); Wed, 21 May 2014 10:45:57 -0400 Date: Wed, 21 May 2014 09:45:54 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Vladimir Davydov cc: hannes@cmpxchg.org, mhocko@suse.cz, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH RFC 3/3] slub: reparent memcg caches' slabs on memcg offline In-Reply-To: <20140521135826.GA23193@esperanza> Message-ID: References: <6eafe1e95d9a934228e9af785f5b5de38955aa6a.1399982635.git.vdavydov@parallels.com> <20140515071650.GB32113@esperanza> <20140516132234.GF32113@esperanza> <20140519152437.GB25889@esperanza> <537A4D27.1050909@parallels.com> <20140521135826.GA23193@esperanza> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 May 2014, Vladimir Davydov wrote: > Seems I've found a better way to avoid this race, which does not involve > messing up free hot paths. The idea is to explicitly zap each per-cpu > partial list by setting it pointing to an invalid ptr. Since > put_cpu_partial(), which is called from __slab_free(), uses atomic > cmpxchg for adding a new partial slab to a per cpu partial list, it is > enough to add a check if partials are zapped there and bail out if so. > > The patch doing the trick is attached. Could you please take a look at > it once time permit? Well if you set s->cpu_partial = 0 then the slab should not be added to the partial lists. Ok its put on there temporarily but then immediately moved to the node partial list in put_cpu_partial().