Received: by 10.192.245.15 with SMTP id i15csp1155506imn; Sun, 11 Mar 2018 05:44:23 -0700 (PDT) X-Google-Smtp-Source: AG47ELtnP/vLq0+bc2BhRFCJLG25Ui1jZy0m6So2ZYIDKxeU6NQsZQ7ZY3RnyAsTsQo+r6R7V5mI X-Received: by 2002:a17:902:6f17:: with SMTP id w23-v6mr4930583plk.336.1520772263050; Sun, 11 Mar 2018 05:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520772263; cv=none; d=google.com; s=arc-20160816; b=So07fl/coE1D4ipN8e7U2uDSDOPlombUXnKtfyhei1m4BHisjeZt+9Qe35NOR61cqw tMDQg4ui+SVHC7w4roDOWxnk6qgBSbVsdNjUynxLJ23NECQc3q333rD7PsUVFb/nfens 6/fLgdq8fPQmqa6xTEfCaaNWmIoDRfPIAbcd6BGabCyl7SEkPIkuVAURM233Ro3IIDAP BOuwhQAW/+I1O5k4EjB5Z9GAXShzcuzznM3I4p8BmlZrGQW5n1fbmGnzQiLYpQlpAP8V YVpbKF9ZHBLDlWrciPU5vovISSufdkUlVJYiLZ8nd0pS6SzfTNHP6C2FUeJAyPMDspyO RvlA== 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 :in-reply-to:subject:cc:cc:cc:cc:cc:cc:cc:cc:from:dkim-signature :arc-authentication-results; bh=C/AoU8mswN/WO9/Nn+Y9JV5dLezE+NN3lddbPd9DQ60=; b=vXFpkAJmP08PssJp2nNdfx0xHkiOFihORcRpQQiE3WWj337Q3i/JFlm4a0itJMGnPl pUoYuBTbp1xXk3UpBJHYKpchzQtT/QjQDvi8xll2gOgcDY1a8Jhp0ZtrlHu/BCGHlwW6 bASC2Byb+WEl/EUia5drVyhFVWmckUF2oDTfI7tK7ow7vBL8rnjST/RW2eXWW3Mf3ujr eYKYr9a13jVwI6/dyxMAr15jAowXOTqBjOPZdWPHqrYxfNGVd3FzEkD3iGN8UEYYVwgr Tx2tfoxhtb1SECkPpTZ9CF0gfe+Zf7YMtjKIlMP6/KJSJOBMI59DQGch2IqB2KvWWg2U pyzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=W6Gs7VcH; 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 f8si3557976pgs.667.2018.03.11.05.44.08; Sun, 11 Mar 2018 05:44:23 -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=W6Gs7VcH; 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 S932268AbeCKMl6 (ORCPT + 99 others); Sun, 11 Mar 2018 08:41:58 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:43313 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932126AbeCKMl4 (ORCPT ); Sun, 11 Mar 2018 08:41:56 -0400 Received: by mail-lf0-f67.google.com with SMTP id q69-v6so19203049lfi.10 for ; Sun, 11 Mar 2018 05:41:56 -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:in-reply-to:date:message-id :mime-version; bh=C/AoU8mswN/WO9/Nn+Y9JV5dLezE+NN3lddbPd9DQ60=; b=W6Gs7VcHOt6dFwQvCi3FCieR+NHAiVa7vdZ3jTk8GauR+T73xSTjWJkkm8rPnp2rkZ 5CEd4qpRd39UUR7FbRpoGun38tqLebiEJyYp+urakiVvdgQFLWde523lxDOIew8jb7Ux mn+PDzSCzybuvDyw6UBR5ou7v5VYWFsEuEbDZIls0iz42n3VEh4EmVPMX5enj5g201j+ NfEENrKaih61pbbkQBPZpdXfXmAArRCXrPr83ym/13wfVXrxi9VMj49kgkWqYJbO+pLW 6kMofrEDm35u6yU1pQHnS39SeyP109cgqLoomVGU5QP8FR0eeCzPveAy0o/o9pcAauit VSWQ== 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:in-reply-to :date:message-id:mime-version; bh=C/AoU8mswN/WO9/Nn+Y9JV5dLezE+NN3lddbPd9DQ60=; b=uS1ip2TW/AijZQ5d08IUdRSXyKB8ZpD38uTbWu+QSSOfFHiOcFLmhbnERaUZ2nyyi1 4FeusAUNNVkSvdMemitGeEbR6OBwiwnohZeZKMyoLO26pyp7EVNf0IfIPRjvTormabvJ ywJ3A9A4Yy22NVd5s50Hw9glU5ccEid+B0D/JudiPnmfzMI4u/vEzNamYLJVHSPmLzaX lsKWKsUbFkJco8VjEgkw+IDFiRArInLmUumr3GaEN0xVvhBeV9a+JUq5nBS21jVvn6MX 9ZgBO582tDlXGNtpkKoMNDrY1kisUlB8NDJkUG8dlLDCsOSdpcqQWBxoE+x0CjMPC3IE u6TA== X-Gm-Message-State: AElRT7HdHTx3pyeTgrwVDfUPQd5lY0gHEkBvbDnSYUoQI6fUwg16dRzH 2fWVBkmE7gG93OArb+tsuNcyZ798WOY= X-Received: by 10.46.20.30 with SMTP id u30mr3112942ljd.12.1520772115252; Sun, 11 Mar 2018 05:41:55 -0700 (PDT) Received: from home (broadband-90-154-68-44.moscow.rt.ru. [90.154.68.44]) by smtp.gmail.com with ESMTPSA id k12-v6sm1214990lfe.93.2018.03.11.05.41.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Mar 2018 05:41:54 -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 In-Reply-To: <87bmfulry9.fsf@gmail.com> Date: Sun, 11 Mar 2018 11:05:29 +0300 Message-ID: <877eqilr71.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 Sorry for strange message in previous mail. remove check that offset greater than cachep->colour bacause this is already checked in previous lines Signed-off-by: Roman Lakeev --- 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