Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751978AbdHGPLJ (ORCPT ); Mon, 7 Aug 2017 11:11:09 -0400 Received: from mail-qt0-f169.google.com ([209.85.216.169]:38243 "EHLO mail-qt0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbdHGPLG (ORCPT ); Mon, 7 Aug 2017 11:11:06 -0400 Date: Mon, 7 Aug 2017 08:11:02 -0700 From: Tejun Heo To: Wei Yang Cc: akpm@linux-foundation.org, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmalloc: reduce half comparison during pcpu_get_vm_areas() Message-ID: <20170807151102.GE4050379@devbig577.frc2.facebook.com> References: <20170803063822.48702-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170803063822.48702-1-richard.weiyang@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 581 Lines: 18 On Thu, Aug 03, 2017 at 02:38:22PM +0800, Wei Yang wrote: > In pcpu_get_vm_areas(), it checks each range is not overlapped. To make > sure it is, only (N^2)/2 comparison is necessary, while current code does > N^2 times. By starting from the next range, it achieves the goal and the > continue could be removed. > > At the mean time, other two work in this patch: > * the overlap check of two ranges could be done with one clause > * one typo in comment is fixed. > > Signed-off-by: Wei Yang Acked-by: Tejun Heo Thanks. -- tejun