Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754233AbcCBOiq (ORCPT ); Wed, 2 Mar 2016 09:38:46 -0500 Received: from mail-oi0-f45.google.com ([209.85.218.45]:36755 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753108AbcCBOip (ORCPT ); Wed, 2 Mar 2016 09:38:45 -0500 MIME-Version: 1.0 In-Reply-To: <56D6DC13.8060008@huawei.com> References: <56D6DC13.8060008@huawei.com> Date: Wed, 2 Mar 2016 23:38:44 +0900 Message-ID: Subject: Re: a question about slub in function __slab_free() From: Joonsoo Kim To: Xishi Qiu Cc: LKML , Linux MM Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 860 Lines: 26 2016-03-02 21:26 GMT+09:00 Xishi Qiu : > ___slab_alloc() > deactivate_slab() > add_full(s, n, page); > The page will be added to full list and the frozen is 0, right? > > __slab_free() > prior = page->freelist; // prior is NULL > was_frozen = new.frozen; // was_frozen is 0 > ... > /* > * Slab was on no list before and will be > * partially empty > * We can defer the list move and instead > * freeze it. > */ > new.frozen = 1; > ... > > I don't understand why "Slab was on no list before"? add_full() is defined only for CONFIG_SLUB_DEBUG. And, actual add happens if slub_debug=u is enabled. In other cases, fully used slab isn't attached on any list. Thanks.