Received: by 10.213.65.68 with SMTP id h4csp153428imn; Tue, 3 Apr 2018 17:41:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ltToBwe0QJq8NeKvU1VlydCI0qU63cD6Lvjd7NQ9xl8IF8iaAS3swRLGL/uir/LnHNHBT X-Received: by 10.98.201.15 with SMTP id k15mr12170193pfg.184.1522802511961; Tue, 03 Apr 2018 17:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522802511; cv=none; d=google.com; s=arc-20160816; b=foeBA5WzmaBCp9gdLBeVR1HJJl9oaYTGoz1gAt8MoqdlH6FsrHhS1J7+h3hr4+o7fg Y4Fpa3AkLxWzCwFRRudhAjQ2QNkixjOSmIcJajeZWkVtVqBcTAzBbvh/mU1S5AN3xOZd aMQKYDplPIAzniAwHSBTybgi1kXM4WsF6f+Mis2tXg9Ut47o5ZJyj01tzwc1mGT4hdkq bjPMTJXTwP5zkBYVrlKs78aGCXnRCN5yA00VERcMX0meC2SpbrbUcOLoSwBra9kqVuEh jf00ON8PLJ95C8vqWr676mmMR8p47Er5+pIMy/nJsqajL9ovNLJ6aR3t5Hca+su9Raw+ K8fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=nojObBENRTHdR70VgdOUswkcxPVnVQZL7cYAPHsPCTA=; b=GHV6mZsm4djxQjZjLFjxk8QH43W3BMyfsZ+D9p0XGUrEqzDMAmf8qgglvDtaK5ok2y 4DNB0GssK8O/qMXMqJfIiKTd1W8ni/x8sO89z/lTRAnPaKVw4sdKVh5cBDGK1zhPYK4L JPe8gCAaZ7jSkj/LsH5ht2sCBaamVolaXfpZjSiqIDKeIPvadhiRhH05HggGktii/+T4 ooSxa9EMVVOVbdCN0MtbkmARdIP7C+N9KOQaB3BXqIxbgYsnDjeUCucHx9npxCVbFczU 1J7cjxmnT03eoHJCIVbYngOapFFKxtC61bQ5zFn7TD46BYNdbAeHrVQkcrOFA/E9xJN8 WQZg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si1730055plo.479.2018.04.03.17.41.36; Tue, 03 Apr 2018 17:41:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753078AbeDDAkb (ORCPT + 99 others); Tue, 3 Apr 2018 20:40:31 -0400 Received: from lgeamrelo13.lge.com ([156.147.23.53]:45359 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbeDDAka (ORCPT ); Tue, 3 Apr 2018 20:40:30 -0400 Received: from unknown (HELO lgemrelse7q.lge.com) (156.147.1.151) by 156.147.23.53 with ESMTP; 4 Apr 2018 09:40:27 +0900 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.220.142) by 156.147.1.151 with ESMTP; 4 Apr 2018 09:40:27 +0900 X-Original-SENDERIP: 10.177.220.142 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Wed, 4 Apr 2018 09:40:27 +0900 From: Joonsoo Kim To: linux-kernel@vger.kernel.org Cc: akpm@linux-foundation.org, cl@linux.com, mm-commits@vger.kernel.org, penberg@kernel.org, rientjes@google.com, sunnyddayss@gmail.com Subject: Re: + mm-slabc-remove-duplicated-check-of-colour_next.patch added to -mm tree Message-ID: <20180404004027.GB6628@js1304-desktop> References: <20180312221333.aYPvPxhxp%akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312221333.aYPvPxhxp%akpm@linux-foundation.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 12, 2018 at 03:13:33PM -0700, akpm@linux-foundation.org wrote: > > The patch titled > Subject: mm/slab.c: remove duplicated check of colour_next > has been added to the -mm tree. Its filename is > mm-slabc-remove-duplicated-check-of-colour_next.patch > > This patch should soon appear at > http://ozlabs.org/~akpm/mmots/broken-out/mm-slabc-remove-duplicated-check-of-colour_next.patch > and later at > http://ozlabs.org/~akpm/mmotm/broken-out/mm-slabc-remove-duplicated-check-of-colour_next.patch > > Before you just go and hit "reply", please: > a) Consider who else should be cc'ed > b) Prefer to cc a suitable mailing list as well > c) Ideally: find the original patch on the mailing list and do a > reply-to-all to that, adding suitable additional cc's > > *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** > > The -mm tree is included into linux-next and is updated > there every 3-4 working days > > ------------------------------------------------------ > From: Roman Lakeev > Subject: mm/slab.c: remove duplicated check of colour_next > > Remove check that offset greater than cachep->colour bacause this is > already checked in previous lines. > > Link: http://lkml.kernel.org/r/877eqilr71.fsf@gmail.com > Signed-off-by: Roman Lakeev > Acked-by: Christoph Lameter > Acked-by: David Rientjes > Reviewed-by: Andrew Morton > Cc: Pekka Enberg > Cc: Joonsoo Kim > Signed-off-by: Andrew Morton > --- > > mm/slab.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff -puN mm/slab.c~mm-slabc-remove-duplicated-check-of-colour_next mm/slab.c > --- a/mm/slab.c~mm-slabc-remove-duplicated-check-of-colour_next > +++ a/mm/slab.c > @@ -2674,11 +2674,7 @@ static struct page *cache_grow_begin(str > 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, Hello, all. This n->colour_next can be update at the other cpu since there is no lock to protect it. So, removing this one another check can make the offset overflow. Andrew, could you drop this patch? Thanks.