Received: by 10.192.245.15 with SMTP id i15csp1150459imn; Sun, 11 Mar 2018 05:26:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELvypPgBmjeQlCIS1UYZ0rWRD1DUkLVCpKORxUMe2eATrxwhppFc61EyHTeGQnC09QW1xwlh X-Received: by 10.99.127.65 with SMTP id p1mr3862812pgn.50.1520771212750; Sun, 11 Mar 2018 05:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520771212; cv=none; d=google.com; s=arc-20160816; b=GtT7dNn36ylMv63TDaRL8cxcbK7EyAyFjY7y6C6j8jLXinYUeVA1sE2ocLYFAKxh9b 8wswOUhaItS9Zvqpo6MGVTiRyxHQp51KafA+qnbUtlSjmsdeziIESj4iZdRQP7AbblDC l37QnY1P0QROuOqZP7oNlC8Ln/YPPrd8JnzyR0ukUdqHrob3WfMBAcfupAauUiatpdWM BVWgijR+8n3YwitKwO8zYlAHPC6Lbvsr0sKLyoawj9rjYWw1Q6mX5j3b7wzcPdiFBh0U ENd12byEuK6aDOXJ5YjN6fHgKwtGPFYxvFjAAqeSepHhxSQEaFWmkPzdehojHJ2X0jVh wzNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:mime-version:message-id:date:subject :cc:cc:cc:cc:cc:cc:cc:cc:from:dkim-signature :arc-authentication-results; bh=cMBe+VTF1LEqDM4NStnqjVhYofMczdahqYsrHr7BG/I=; b=QUoMVEW6bv/ZJbixXQiK37hN2aMoWlKkyKPgsIQsDsJjdozaUjejGe8QSvpdchMOIV KlMlqwIY0HOf8Irti4kde6kb8ViefyoltKe52mn8Sd9WoTDhGvrvDppw2SU6GvzRLQLA 9P/+ejq92WuYtZlhkGAuUg9Fd5uToqT7Bh7IpYClN7peh+LLlF1pumZRWpU1BmLzo9Ul 6nZdISb0/617EJh12IHdGEW+cela0HLbqPaqsIXfp6DN8+UNEdhoDIrpHmsmit0rih0X ojfiIoGeXTzL/v4RNggwsrfiC7t2fhx6dVVTjxB1TfOlqt2PlXwMpcyED0kdjtdhP4Kr 8PeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AE3zNM+/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si3591528pgr.410.2018.03.11.05.26.36; Sun, 11 Mar 2018 05:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AE3zNM+/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932162AbeCKMZk (ORCPT + 99 others); Sun, 11 Mar 2018 08:25:40 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:41412 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932126AbeCKMZi (ORCPT ); Sun, 11 Mar 2018 08:25:38 -0400 Received: by mail-lf0-f68.google.com with SMTP id m69-v6so19191651lfe.8 for ; Sun, 11 Mar 2018 05:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:cc:cc:cc:cc:cc:cc:cc:cc:subject:date:message-id:mime-version; bh=cMBe+VTF1LEqDM4NStnqjVhYofMczdahqYsrHr7BG/I=; b=AE3zNM+/7K4rULMi39iYzAQT8nO4fRTgeGn2r8bem3G/cyeJNLvEx0gUX3zgDnLq6m V7V53Y2Br0udeRBrke2PCCdm2vhezJXkqxsfhudqv5g9ROp2IHMb2sPojDuTiGNxdaiT b1sr7os9B5Jscjul5sI99hU1Ww7Y1X1aXe1hNa+xoHdgnQaA//NIRNgWCPaqG2z7ExBD t7SP/aXMrOE+5f7//GaaUow8N0Xw43LxfpRjTo3+dvWzO+/v0/QhHGMBQAqoJ1KSUcIc Qc3TotJXOLlIfgoihnCmePruhkzXex/k22/HTqXxV1Gq5L0eReWZoXZNy2Ag3d9MYzce Jh8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:cc:cc:cc:cc:cc:cc:cc:cc:subject:date :message-id:mime-version; bh=cMBe+VTF1LEqDM4NStnqjVhYofMczdahqYsrHr7BG/I=; b=cU0KUia7Lg8EJsOgnXhDx+3vrFNeyG4l6I3bvpWmP3AJIlq3QMLdw7eSoyQErgr2q6 TUur0JRz5pOLKnIF86GwxdyLbYp79RGXtEeXiCmf43uom1zJI18oJWly8C2Wt2JkZFt/ vdI0m45eu1FBNRA4mJvH+a66vrvZh3LZ+w//FDSnNfbzXn0so190DinocTvmMz35g66i vXZq4Ldyhypr6T62KKEJPXv2kxA2HRp6rEkPRK0nYF1TxmZ5qoKbDE1f7W3ItX+meIcJ pdoJt4g3nL1QVM5OdwSzj099LWxVkHVCbwCnljawlQqzG3RPqGxDZCbfOYMpsXSakcMz YrSw== X-Gm-Message-State: AElRT7FK5ftiPEotnWH6o5+2oKVAG4FaeUr90EGfW2KN8BT5tUwZK1Wt OfKeYSmPx2K5PmY8kkGt5zKpblCUMfM= X-Received: by 10.46.145.131 with SMTP id f3mr3039857ljg.134.1520771137068; Sun, 11 Mar 2018 05:25:37 -0700 (PDT) Received: from home (broadband-90-154-68-44.moscow.rt.ru. [90.154.68.44]) by smtp.gmail.com with ESMTPSA id q129-v6sm1216746lfe.37.2018.03.11.05.25.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Mar 2018 05:25:36 -0700 (PDT) From: Roman Lakeev Cc: Roman Lakeev Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] mm/slab.c: remove duplicated check of colour_next Date: Sun, 11 Mar 2018 15:25:34 +0300 Message-ID: <87bmfulry9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Date: Sun, 11 Mar 2018 11:05:29 +0300 Signed-off-by: Roman Lakeev remove check that offset greater than cachep->colour bacause this is already checked in previous lines --- mm/slab.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 324446621b3e..6a48f122bd82 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(struct kmem_cache *cachep, if (n->colour_next >= cachep->colour) n->colour_next = 0; - offset = n->colour_next; - if (offset >= cachep->colour) - offset = 0; - - offset *= cachep->colour_off; + offset = n->colour_next * cachep->colour_off; /* Get slab management. */ freelist = alloc_slabmgmt(cachep, page, offset, -- 2.16.2