Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9080364rwl; Wed, 11 Jan 2023 00:55:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXsjxxg5GJmrce5go5kzRIYAVl2VpNbcmpecD0v+ygtBrao6850fOqClmpX3IJxDwl+3wVQj X-Received: by 2002:aa7:c78a:0:b0:498:f2d:f52e with SMTP id n10-20020aa7c78a000000b004980f2df52emr14152879eds.21.1673427311691; Wed, 11 Jan 2023 00:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673427311; cv=none; d=google.com; s=arc-20160816; b=yux3IMNOMCvKa4z0rmrC25slotpWYUVJGkwpfdeimOdyX1i4abxRClhwsm04S/RMsb XuyPDjOYqNVRL46Ie7EZkQzxj6+4BZ5/RtIHSgk6p3qtXxshpEVYDkBVIlpbuiC7dSvU Uigu46uMf0qeiJlpon921ZJAM8xBBkMVEXfjmeRT8EPZqk/D4H4P9uTOWhBTmEmqIpXT v2Xd9YjF6ttokbTQTR/B3VLMUxcliYauMNNZFPIFystjhZLWSMe0H7AGBCz49z6mo3tI cFOcdJt5rpxASw4k5WaZH7+0ZsiLuOZzKRdYlUtIFCKQOe5CqDVu9xkQKSVeXzWpcD5n 938w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:signed-off-by :mime-version:message-id:date:subject:cc:to:from; bh=aLNYl0+0r3CD6inAVoFiwAvv293IJ57CvXGCgrbezfo=; b=CWWsXCViqxm8Mmo8Cv5McD9WLDTvOZBRC+fONjxxUAg44tO84QxU7NXbpb3OKigYfx TRbflSPMYvzYlEKzRgAHi1IHdDxbOrUIzpoTHozogJhQYSa9DzkHOSVYeyQzyzh59rEi 79q/J7ghZ1DnNdw1b3WqDQVXYf7KYDtvcjsS8pKztu3z7HLQXqVrVuDcbtkhop9o9X5M mhqvWQLigMXDu2ZxLlaMzpI8V8TJT83gnV9EJUmSOfzCxwzK/Zs0vQJO3kJgIehIvmWn eHsQ5pXOXDw84x8QYrcYQJK+UIIhrPA/yr6GY1+FUCA/qjJfCsuEFl6tOO0SwwaEQ+d5 wZRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm24-20020a05640222d800b0046aff5119c6si12836434edb.428.2023.01.11.00.54.58; Wed, 11 Jan 2023 00:55:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232134AbjAKIbb (ORCPT + 53 others); Wed, 11 Jan 2023 03:31:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230074AbjAKIb0 (ORCPT ); Wed, 11 Jan 2023 03:31:26 -0500 Received: from mail.nfschina.com (unknown [42.101.60.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE489265F for ; Wed, 11 Jan 2023 00:31:24 -0800 (PST) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id C08611A00A21; Wed, 11 Jan 2023 16:31:38 +0800 (CST) X-Virus-Scanned: amavisd-new at nfschina.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mUdh5k6JJs8p; Wed, 11 Jan 2023 16:31:38 +0800 (CST) Received: from kernel.localdomain (unknown [219.141.250.2]) (Authenticated sender: lvqian@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id BDA111A00A1C; Wed, 11 Jan 2023 16:31:37 +0800 (CST) From: lvqian@nfschina.com To: cl@linux.co, penberg@kernel.org, rientjes@google.com, kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, lvqian Subject: [PATCH] mm/slab.c: Delete the if judgment and return the result directly Remove the if judgment and return the result directly to reduce assembly statements. Date: Wed, 11 Jan 2023 16:31:02 +0800 Message-Id: <20230111083102.111535-1-lvqian@nfschina.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Signed-off-by: lvqian Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: lvqian diff --git a/mm/slab.c b/mm/slab.c index 7a269db050ee..713265fe2dea 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -1415,11 +1415,8 @@ static void kmem_rcu_free(struct rcu_head *head) #if DEBUG static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) { - if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && - (cachep->size % PAGE_SIZE) == 0) - return true; - - return false; + return debug_pagealloc_enabled_static() && OFF_SLAB(cachep) && + ((cachep->size % PAGE_SIZE) == 0); } #ifdef CONFIG_DEBUG_PAGEALLOC -- 2.34.1