Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127AbcCCBd1 (ORCPT ); Wed, 2 Mar 2016 20:33:27 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:62898 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbcCCBdZ (ORCPT ); Wed, 2 Mar 2016 20:33:25 -0500 Message-ID: <56D792DD.5010202@huawei.com> Date: Thu, 3 Mar 2016 09:26:53 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Joonsoo Kim CC: LKML , Linux MM Subject: Re: a question about slub in function __slab_free() References: <56D6DC13.8060008@huawei.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.56D79328.0010,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5fd92f7e9570e739afb787d3dfaacb03 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 991 Lines: 37 On 2016/3/2 22:38, Joonsoo Kim wrote: > 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. > Hi Joonsoo, You are right, thank you very much! >