Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755048Ab3GASTr (ORCPT ); Mon, 1 Jul 2013 14:19:47 -0400 Received: from a9-58.smtp-out.amazonses.com ([54.240.9.58]:58669 "EHLO a9-58.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755029Ab3GASTo (ORCPT ); Mon, 1 Jul 2013 14:19:44 -0400 Date: Mon, 1 Jul 2013 18:19:43 +0000 From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Zhang Yanfei cc: penberg@kernel.org, mpm@selenic.com, Linux MM , "linux-kernel@vger.kernel.org" , Zhang Yanfei Subject: Re: [PATCH] mm, slab: Drop unnecessary slabp->inuse < cachep->num test In-Reply-To: <51D1AE84.8010404@gmail.com> Message-ID: <0000013f9b76364e-6d24303e-93bc-425d-9933-710b0587b56b-000000@email.amazonses.com> References: <51D1AE84.8010404@gmail.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SES-Outgoing: 2013.07.01-54.240.9.58 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 698 Lines: 16 On Tue, 2 Jul 2013, Zhang Yanfei wrote: > From: Zhang Yanfei > > In function cache_alloc_refill, we have used BUG_ON to ensure > that slabp->inuse is less than cachep->num before the while > test. And in the while body, we do not change the value of > slabp->inuse and cachep->num, so it is not necessary to test > if slabp->inuse < cachep->num test for every loop. The body calls slab_get_obj which changes slabp->inuse! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/