Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp562189ima; Fri, 15 Mar 2019 08:54:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzphw0OklLnDtX74Hnl783CXl2T7oQUNlCLwt+SSXARvAo3t5z/LbTVtqTstIaz7U/Q560X X-Received: by 2002:a17:902:b70c:: with SMTP id d12mr5086651pls.88.1552665295069; Fri, 15 Mar 2019 08:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552665295; cv=none; d=google.com; s=arc-20160816; b=kvRoMu1usKC+zEFicFp+JXTW9SLFkHF8b8QW4+9CXHX4foxeLzESHWjigPHD97Zm2L /+iecOzHxzDxzj8hwksUWGcRSW/3dFAPI9BCmwltHKdw0/n4mKbVVlqiCxvrnxVj2Vnf ShcMuNQ5uDPPuw/tZD0KWbc3WxZvy1GihpYw8wShgOMnBWc9YqBgPKUvYAYIWGB8JNTO XkdLTX+ipnYSTmUwI0/VE64vuwkF4i6nAVpAi6rxx9dZuyNC6Nn0GbbA2KJY5Db8mEJr e+831hcnZYQ3uoaftqUj9OlqgNj8d0eY1n4smpFH9+W3lg7Mz380PDAUm204C49crpzb QdwQ== 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:date:from:dkim-signature; bh=VdqcDWXkpQ28Nb7+p+7S50j4iA+Z3tTQHBWP9JJnlKI=; b=u3syTh4wdHrthjiFzr/ndjf/qhvhzg+m9lI/YN5Px4toHnCG0iW/ASBril0FdW6ZFZ AAABvhZw52gjSDZtCvpjY4ITq21bPWiu3cP5kmuXDAJLQSuBg8s9RBH1iag7agBtbH4N 5sc3OldeGCCY8HuMa9q8kZoqua/NHX4+H3asTJEsJi48BU40OGpDo0Dbi+r+0HTP8bCx nUJaiBiE71OTW36A2pguGZgVtUQ8xZkga5KRagDefitaAyRMcgletl3xAsCe2lt4IYxg JVHNlT2oYe9Pc0aOi9LS2CTJLDeeRVxrNs/YZkYYeKPGSBRjGH00g/LazJd3XQHnVZIC iP4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vK1D3AZs; 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 l13si2145901pgg.281.2019.03.15.08.54.38; Fri, 15 Mar 2019 08:54:55 -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=vK1D3AZs; 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 S1729375AbfCOPyA (ORCPT + 99 others); Fri, 15 Mar 2019 11:54:00 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:32798 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727826AbfCOPyA (ORCPT ); Fri, 15 Mar 2019 11:54:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id i7so3546529pgq.0 for ; Fri, 15 Mar 2019 08:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VdqcDWXkpQ28Nb7+p+7S50j4iA+Z3tTQHBWP9JJnlKI=; b=vK1D3AZsbmOsc1xEzacb4OVMoof67BXA99tAXZm6TihSKgSRjYsL+ELcU5MIvqod1u wrECo66SarjooBzfwYJh7d3qTKUBQ/3CDpNVCHNqJ+oki/v/GiI1eAJQ+ZrnVLrU6Zt0 U5KdbmCHTaHEj5dF1p8IBaOTOMuMYeXWApFCUpXqKapqgZs7tMsjxlY8fqwPZuaZoEQf caNrlFzLlRO7JkdcBZfBBhaidABub9fu4ZNVdmM36WPZn1FC6jCaXD1Bm3dBLTwGc4Ec JEv76aWLQmfD+5X8PtblYlge1a+lr/Nflt9RPpmCOZAyM6fMUb/Ie+sYzvkMSnA499eR Hijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=VdqcDWXkpQ28Nb7+p+7S50j4iA+Z3tTQHBWP9JJnlKI=; b=DNNFCbCrUVdywbMBiHasxRogUynqcLdTOVaQIJIkymwfg/84YdiJJB9JbqpHqwnsDt mh37KS83f65WW165P02W3FaVpm+Yz0G+CdUfExIXuF0WJ+WhN9S1EZozMxA2dB/HKl1x EER68xIh6f1B6tC2gk6iM80k9d2oGOY54LWfVkARnmC4erzazpUUFJA0L5GgS0g1xIk4 OgBfWsil34URtRYCCfwm6rgJd/NFetvGNh/bqCFtKYsn+3szYkM/WDALHo3BZ01b0MB5 26sA38PqV5Kk5tSYorV5nWgSy6bNuQfJymRi9tmPcS5FIujlS9cdManKWvxLsbf0wMPY YFGg== X-Gm-Message-State: APjAAAV52M3aviZaoApSUzO02B8IgjJgOEb0GfUCx6BarxwTPqCuD6s0 XUkTIJQ+itibZMJFuit++ko= X-Received: by 2002:a63:e801:: with SMTP id s1mr4114039pgh.378.1552665238967; Fri, 15 Mar 2019 08:53:58 -0700 (PDT) Received: from localhost ([2607:fb90:6d5:a4be:c057:734:2567:9ba6]) by smtp.gmail.com with ESMTPSA id c130sm4807194pfb.145.2019.03.15.08.53.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Mar 2019 08:53:57 -0700 (PDT) From: Yury Norov X-Google-Original-From: Yury Norov Date: Fri, 15 Mar 2019 18:53:51 +0300 To: Yury Norov Cc: Andrew Morton , Andy Shevchenko , Arnd Bergmann , Dmitry Torokhov , Kees Cook , Matthew Wilcox , Michael Ellerman , Rasmus Villemoes , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/5] lib: rework bitmap_parselist and tests Message-ID: <20190315155351.GA26426@yury-thinkpad> References: <20190220083705.14050-1-ynorov@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190220083705.14050-1-ynorov@marvell.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping? On Wed, Feb 20, 2019 at 11:36:59AM +0300, Yury Norov wrote: > bitmap_parselist has been evolved from a pretty simple idea for long and > now lacks for refactoring. It is not structured, has nested loops and a > set of opaque-named variables. All this leads to extremely hard > understanding of the code. Once during the optimization of it I missed a > scenario which leads to kernel hangup. Tetsuo Handa spotted this and found > it simpler to rewrite the code instead fixing it. (Though, that attempt > had some flaws.) > https://lkml.org/lkml/2018/4/1/93 > > Things are more complicated than they may be because bitmap_parselist() > is part of user interface, and its behavior should not change. > > In this patchset > - __bitmap_parselist() is reworked (patches 2 and 3); > - time measurement in test_bitmap_parselist switched to ktime_get > (patch 4); > - new tests introduced (patch 5), and > - bitmap_parselist_user() testing enabled with the same testset as > bitmap_parselist() (patch 6). > > Patch 1 is a fix and may be applied separately. > > V1: https://lkml.org/lkml/2018/12/23/50 > v2: - use PTR_ERR() and ERR_PTR() where appropriate; > - fix parser logic (last byte of string handling); > - tests for bitmap_parselist_user() in patch 5. > > Yury Norov (4): > bitmap_parselist: don't calculate length of the input string > bitmap_parselist: move non-parser logic to helpers > bitmap_parselist: rework input string parser > lib/test_bitmap: switch test_bitmap_parselist to ktime_get() > lib/test_bitmap: add testcases for bitmap_parselist > lib/test_bitmap: add tests for bitmap_parselist_user > > lib/bitmap.c | 293 ++++++++++++++++++++++++++++++---------------- > lib/test_bitmap.c | 67 +++++++++-- > 2 files changed, 245 insertions(+), 115 deletions(-) > > -- > 2.17.1