Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1814097imm; Tue, 22 May 2018 09:44:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoetR4y75ezSYLCI/azjsjth++ftTWRCoEMp4R+baRu6A0vlKQ97wFsUjPgvxGD3oJ8zckI X-Received: by 2002:a17:902:b114:: with SMTP id q20-v6mr11972790plr.383.1527007441138; Tue, 22 May 2018 09:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527007441; cv=none; d=google.com; s=arc-20160816; b=FxyXBW8ogGtqOfy8OTTbCdy+tqH/zWWHTMQjAoRVibivO3B+DAE/0mHFUYNbOp8zHR KHneLXKt/IB0XiLYprelKxTDhd8ih8fXs0aNX7xTjg8mMDuSBS1OR30R7qZ82/JvrG1T J7VTZFVRVhXQLPwrLWp3IIThkT+rsIAgbYH1QX8RD/EAB3ZlGrEGO8kHgHQzB0iKYnZf 6BaGL5kYXr9wsQN66bynBHtBQkB8+d1Gv1vVUF7HoAMfWBgDq4nj5n46biYFu93Hy5GS uIQowfMQGFK8qHWDLOhcXUMUiabV2kXLS0Qes9fitjVLoboV3QAfHMh3GLzwjMBa+Dqr Z02g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=cfJvIw5dHStyBsK1x+6jU/GA8jGbDlqwQ4i4LqQIuK8=; b=vxaV92EMkBTxnn9HTB+hznyZj5RYyQ05jV2KCzKnbSRnwvIlSEi4LJD8HjGI/o/w4G YR2e1DtuzcEMPR9QPDBUxxVlWLc0aZdyvYshxH3JHitnhPyr+IA1afUmO+mP6uwOKZQ0 OJGk5z8d0uFpydqjEh9tvc8pStblMpVIW0UqNbMZI8UWQrYCWbxKmCXoxyiec3mAMcv/ 601sy0QZsl/h74Q0yoR6QeLIJrd5oSeNvMCQd8fmOpzMtQSFgiA5dm5tZ2cXjV39ipVl wEBdEFugla5NAxFg0hQkhzq3+GZ9BxIfXpTy/RR9GPFAfN5CJetJkGbq5JSmIfEq8eGA a66Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=KmhSvcoe; 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 p33-v6si16634090pld.318.2018.05.22.09.43.46; Tue, 22 May 2018 09:44:01 -0700 (PDT) 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=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=KmhSvcoe; 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 S1751653AbeEVQnL (ORCPT + 99 others); Tue, 22 May 2018 12:43:11 -0400 Received: from a9-46.smtp-out.amazonses.com ([54.240.9.46]:50626 "EHLO a9-46.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751404AbeEVQnD (ORCPT ); Tue, 22 May 2018 12:43:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1527007382; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=ifK5nphAsIvboDdGhQRXC44uOJcpD6cBQHzAowxFlf4=; b=KmhSvcoe/8KozPIjq1LtNQnQUsyAm08sDtM1VVRVyZN+1mjF9JZI4fAjqeKDxiKw Gfz0DpjpU12KDH3vZotMbWcSaFR2fzR31XF0yvMdHQc5x+ELbdidm6pc8UcjxRvmFUn HUrYugKfhcaqvLw6q+hZF9LhWhKtmkErZC6baDTU= Date: Tue, 22 May 2018 16:43:02 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Andrew Morton cc: Shakeel Butt , Michal Hocko , Greg Thelen , Pekka Enberg , David Rientjes , Joonsoo Kim , Johannes Weiner , Vladimir Davydov , Tejun Heo , Linux MM , cgroups@vger.kernel.org, LKML Subject: Re: [PATCH] mm: fix race between kmem_cache destroy, create and deactivate In-Reply-To: <20180521114227.233983ac7038a9f4bf5b7066@linux-foundation.org> Message-ID: <0100016388bb8ade-de95df0e-6154-4ddc-98bb-ee33811cca85-000000@email.amazonses.com> References: <20180521174116.171846-1-shakeelb@google.com> <20180521114227.233983ac7038a9f4bf5b7066@linux-foundation.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2018.05.22-54.240.9.46 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 May 2018, Andrew Morton wrote: > The patch seems depressingly complex. > > And a bit underdocumented... Maybe separate out the bits that rename refcount to alias_count? > > + refcount_t refcount; > > + int alias_count; > > The semantic meaning of these two? What locking protects alias_count? slab_mutex > > > int object_size; > > int align; > > > > diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h > > index 3773e26c08c1..532d4b6f83ed 100644 > > --- a/include/linux/slub_def.h > > +++ b/include/linux/slub_def.h > > @@ -97,7 +97,8 @@ struct kmem_cache { > > struct kmem_cache_order_objects max; > > struct kmem_cache_order_objects min; > > gfp_t allocflags; /* gfp flags to use on each alloc */ > > - int refcount; /* Refcount for slab cache destroy */ > > + refcount_t refcount; /* Refcount for slab cache destroy */ > > + int alias_count; /* Number of root kmem caches merged */ > > "merged" what with what in what manner? That is a basic SLUB feature.