From patchwork Mon Oct 4 13:46:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12534153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D2CFC433F5 for ; Mon, 4 Oct 2021 14:30:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1B32561372 for ; Mon, 4 Oct 2021 14:30:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1B32561372 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 9D58B94003C; Mon, 4 Oct 2021 10:30:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 984AA94000B; Mon, 4 Oct 2021 10:30:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 873F294003C; Mon, 4 Oct 2021 10:30:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7418D94000B for ; Mon, 4 Oct 2021 10:30:30 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 13D33181AEF1E for ; Mon, 4 Oct 2021 14:30:30 +0000 (UTC) X-FDA: 78658990620.04.B11EB3A Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 9DE8BD03885E for ; Mon, 4 Oct 2021 14:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=MTPfjwjEO8iLMn79GIpKe/tWLPxEwdidd1nR5RiMsi8=; b=oJxWKqqDWk86a+jbf4XNTizOXc Y4pBpaBZOBj0VXFekkWhNPIOS0yBXeaN/zXs90FHm2Uc0iDEG8UO/VngFfKS2WHaARI1Dr1VNdhAW xR8K/j2COaAdOX1f3zq8yJs9OWOEgoL6zG1UPgXdMbKJaOUorSraKqnJabzcB5rHDrjib5VtfE/r4 aKbpeI/J6Fp+ibCd6WBcoGRvP7rxmPh1Dv1+CT6H1J+YsvO9azE0L+5G4o3CGehvZnW3wvX41Mj8K eNmh5UyhNCKw9V6dehtwPQe3otSHBJIAGxfP+2QpBQTIj3HeH9tPh70gz1xNpkOWPqZcGzzQFRVAK AfVh0qNw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXOxh-00GzsF-Np; Mon, 04 Oct 2021 14:29:19 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" Subject: [PATCH 33/62] mm/slub: Remove struct page argument to next_freelist_entry() Date: Mon, 4 Oct 2021 14:46:21 +0100 Message-Id: <20211004134650.4031813-34-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211004134650.4031813-1-willy@infradead.org> References: <20211004134650.4031813-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9DE8BD03885E X-Stat-Signature: hfq4sf351ot4yb3b891axwdr7fwtociq Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=oJxWKqqD; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1633357829-789438 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This argument was unused. Fix up some comments and rename a parameter. Signed-off-by: Matthew Wilcox (Oracle) --- mm/slub.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 9a67dda37951..14a423250611 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1809,23 +1809,23 @@ static void __init init_freelist_randomization(void) } /* Get the next entry on the pre-computed freelist randomized */ -static void *next_freelist_entry(struct kmem_cache *s, struct page *page, +static void *next_freelist_entry(struct kmem_cache *s, unsigned long *pos, void *start, - unsigned long page_limit, + unsigned long slab_limit, unsigned long freelist_count) { unsigned int idx; /* - * If the target page allocation failed, the number of objects on the - * page might be smaller than the usual size defined by the cache. + * If the target slab allocation failed, the number of objects in the + * slab might be smaller than the usual size defined by the cache. */ do { idx = s->random_seq[*pos]; *pos += 1; if (*pos >= freelist_count) *pos = 0; - } while (unlikely(idx >= page_limit)); + } while (unlikely(idx >= slab_limit)); return (char *)start + idx; } @@ -1848,13 +1848,12 @@ static bool shuffle_freelist(struct kmem_cache *s, struct slab *slab) start = fixup_red_left(s, slab_address(slab)); /* First entry is used as the base of the freelist */ - cur = next_freelist_entry(s, slab_page(slab), &pos, start, slab_limit, - freelist_count); + cur = next_freelist_entry(s, &pos, start, slab_limit, freelist_count); cur = setup_object(s, slab_page(slab), cur); slab->freelist = cur; for (idx = 1; idx < slab->objects; idx++) { - next = next_freelist_entry(s, slab_page(slab), &pos, start, slab_limit, + next = next_freelist_entry(s, &pos, start, slab_limit, freelist_count); next = setup_object(s, slab_page(slab), next); set_freepointer(s, cur, next);