Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1776892pxb; Thu, 28 Oct 2021 09:49:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz6+TD1qaeGq1vgJalbrEHMljELF5z7mPqqa22K7uxSCcKkToiT/SI7UQ7XyryI30edu7X1 X-Received: by 2002:a63:7e42:: with SMTP id o2mr4022527pgn.296.1635439786997; Thu, 28 Oct 2021 09:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635439786; cv=none; d=google.com; s=arc-20160816; b=Jwj62c4gilGuKq0IMPO47olmk7if9m8L3HjmAZiRVEvCUM4OD/p5asxxrh2BjRqE8S 1Orxs3/BfcB1eKEJtgsQmwM4Y1GaRFAKXhXpLfMw7g1WND2xv7EeNMPV2TZR6VKrEc78 LnKnZ24RFp5uOUHLTen1C3uEsIyKZl6Oosle9xwDZcukLHWuhsXUqzjGdIP8bSlKqbaM G6Z9jLZtn7jXORO7h1C5wW0iDGp7a6h7FsVqJacax4vCFcPCbVlDiDiVfL/lI2qG6aIC dnyFv7FazZZC4BdVWSQH2z5CV+DtOWcJxxU+wiPunJLeMMleTFKh4NT7bjYFPkhT7YGb g+fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=M8Jw/S2n3WB7bDRByTQGeQns0CvXOlde4kiN/IEV98o=; b=qGxGda4jvWcrpJw8F+/KoAnVXf1oD4CILtZZHDGiiqtvBPh1ODY+GIbvdO7aDKCA4C qKWPnZ625jaFSHhaV3cTt0WlXzBLz+Jpzp/6VZfWAhy6cUNSOsnEeoSCxWlDmIYljnzW BSgbgdBtgmtePnu7EyhEWC8hk0tQW3rfOYpwMwNlLzQ7gjb+FapN4fWjPNfRz4p/zCeb 63B402ZLgbVqJGx9bYCjVQmG36iPgozMqL6/dVTKkax1pajLwxzNpzCG8nGXuvXLkF3n 5rqaD8v867sdx2IvU3+0Kf/wQ7Efc16eMQ8szJBzU9PEU5GykFALarP6sA6J7WIaYfs+ s84w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=PR8boEcK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si4774700pls.321.2021.10.28.09.49.18; Thu, 28 Oct 2021 09:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@usp.br header.s=usp-google header.b=PR8boEcK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=usp.br Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230410AbhJ1Quo (ORCPT + 99 others); Thu, 28 Oct 2021 12:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230377AbhJ1Quo (ORCPT ); Thu, 28 Oct 2021 12:50:44 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 742F7C061570 for ; Thu, 28 Oct 2021 09:48:16 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id s1so27469810edd.3 for ; Thu, 28 Oct 2021 09:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M8Jw/S2n3WB7bDRByTQGeQns0CvXOlde4kiN/IEV98o=; b=PR8boEcK6RSO8eaafJJSJzKy+NQsdbysFi/aCXaszc/wOVJoO+mM0BaQ6dPPy9xKKq XnNEfSSYf9NJ3digurFFHlOYis4fL1gGKHiQJHJIvXMQ4steyAzNeh+mP1AK2b9WWabC f7D+pHU75jrNCG78NwUNk2dljTXfS61O+bxbPg2vKADcyExEWkmhVq0718tTQhcinK9w TrDOa5w2oDLuEJVR/+IfpAsuAczb1VG+l8ewlLw6o7j3/dJvOJGZfmijAvwegEmqjENt EWGl12GBnC3849MIoXM3qGsBe5i48hPnBsQsfxDsBgeZTAowHUX3drMfakwzmRW+aHTa 8HEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M8Jw/S2n3WB7bDRByTQGeQns0CvXOlde4kiN/IEV98o=; b=q9Ze2+lH2Dd3RFVv3DLDdvJuCxkdWnENJCScew7S3N7zzwYonI2rnvZ1shxXZLvBij jGMFjuRL7a+DdMQzuT+G15WLniG4BmnCV+cSsnQoEP35odnpOLPDbsmkbbT+7dIRmVKf m2EAfjgGcxwqBTMA5Qhd3pincxP23D0xE5lOylMQUSK4HeLN4rEcNRmguyfVylBrGo2+ WLm44nViyGpTiyPpvHgK87k0VI/m7kHOu5n9feGOgCnvspWy6k2Ziz2plmxDEaAS4pzP q1oNn1hyo5BWIBSOLxOfhTkSyva0uSGCXJ8qxQuPmY27s3hm3YGcysvoPfIskKUkSF1j lbGQ== X-Gm-Message-State: AOAM533kQTP1KjT4DOiOe3/pOzfQKYidVMHtJgS6c60BBg1s04JIULbB pwVUfKWPR5YEUbgBZKDHJDjDKACafy6au/JosSm92g== X-Received: by 2002:a50:e686:: with SMTP id z6mr7820251edm.311.1635439694998; Thu, 28 Oct 2021 09:48:14 -0700 (PDT) MIME-Version: 1.0 References: <20210926223322.848641-1-isabellabdoamaral@usp.br> In-Reply-To: From: Isabella B do Amaral Date: Thu, 28 Oct 2021 13:48:03 -0300 Message-ID: Subject: Re: [PATCH v2 0/5] test_hash.c: refactor into KUnit To: Brendan Higgins Cc: David Gow , Shuah Khan , Geert Uytterhoeven , Enzo Ferreira , =?UTF-8?Q?Augusto_Dur=C3=A3es_Camargo?= , Daniel Latypov , "open list:KERNEL SELFTEST FRAMEWORK" , Linux Kernel Mailing List , KUnit Development , ~lkcamp/patches@lists.sr.ht, Rodrigo Siqueira Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On Tue, Oct 5, 2021 at 6:19 PM Brendan Higgins wrote: > > +Shuah Khan > > On Sat, Oct 2, 2021 at 12:30 AM David Gow wrote: > > > > On Mon, Sep 27, 2021 at 6:33 AM Isabella Basso wrote: > > > > > > We refactored the lib/test_hash.c file into KUnit as part of the student > > > group LKCAMP [1] introductory hackathon for kernel development. > > > > > > This test was pointed to our group by Daniel Latypov [2], so its full > > > conversion into a pure KUnit test was our goal in this patch series, but > > > we ran into many problems relating to it not being split as unit tests, > > > which complicated matters a bit, as the reasoning behind the original > > > tests is quite cryptic for those unfamiliar with hash implementations. > > > > > > Some interesting developments we'd like to highlight are: > > > > > > - In patch 1/5 we noticed that there was an unused define directive that > > > could be removed. > > > - In patch 4/5 we noticed how stringhash and hash tests are all under > > > the lib/test_hash.c file, which might cause some confusion, and we > > > also broke those kernel config entries up. > > > > > > Overall KUnit developments have been made in the other patches in this > > > series: > > > > > > In patches 2/5, 3/5 and 5/5 we refactored the lib/test_hash.c > > > file so as to make it more compatible with the KUnit style, whilst > > > preserving the original idea of the maintainer who designed it (i.e. > > > George Spelvin), which might be undesirable for unit tests, but we > > > assume it is enough for a first patch. > > > > > > This is our first patch series so we hope our contributions are > > > interesting and also hope to get some useful criticism from the > > > community. :) > > > > > > Changes since V1: > > > - Fixed compilation on parisc and m68k. > > > - Fixed whitespace mistakes. > > > - Renamed a few functions. > > > - Refactored globals into struct for test function params, thus removing > > > a patch. > > > - Reworded some commit messages. > > > > > > [1] - https://lkcamp.dev/ > > > [2] - https://lore.kernel.org/linux-kselftest/CAGS_qxojszgM19u=3HLwFgKX5bm5KhywvsSunuBAt5RtR+GyxQ@mail.gmail.com/ > > > > > > > Thanks: I've gone through this new revision, and it still works fine, > > and my prior comments have been addressed. The commit messages in > > particular are much clearer, thank you! I've reviewed the various > > patches and left a few comments here and there, but there's nothing > > too drastic. > > > > I'm pretty happy with this from the KUnit side, but it would be ideal > > if someone with more knowledge of the hash functions looked over it. > > Unfortunately, George's email is bouncing, and no-one else has made > > any particularly major changes to this. I'm glad to hear this :) I'd also like to point out that "George Spelvin" is a rather unusual figure [3] so we shouldn't be expecting much back from him, anyway. Maybe I should've looked that up before trying to tackle this patch, as I've no idea who might be able to properly review the hash part of it. > > > > My only remaining comment on the tests themselves is that it'd be nice > > to have them split up further into more, smaller tests. Given that > > it's a port of an existing test, though, I understand the desire not > > to change things too drastically. Thanks for your comprehension! > > > > We also need to work out how this is going to go upstream: does it go > > through the kunit branch (via Shuah's kselftest repo), or directly to > > Linus (who's handled most of the other recent-ish changes here. > > Brendan, any thoughts? > > I think Shuah should take them in 5.16. > > Shuah, let me know if you are OK taking these in 5.16 and I will > update the patch tracker. > Thanks a lot for your interest in this patch :) We were a little worried about who might be able to get it upstream, so we appreciate that you also thought of this! > > Cheers, > > -- David > > > > > > > > > Isabella Basso (5): > > > hash.h: remove unused define directive > > > test_hash.c: split test_int_hash into arch-specific functions > > > test_hash.c: split test_hash_init > > > lib/Kconfig.debug: properly split hash test kernel entries > > > test_hash.c: refactor into kunit > > > > > > include/linux/hash.h | 5 +- > > > lib/Kconfig.debug | 28 ++++- > > > lib/Makefile | 3 +- > > > lib/test_hash.c | 247 +++++++++++++++++-------------------- > > > tools/include/linux/hash.h | 5 +- > > > 5 files changed, 139 insertions(+), 149 deletions(-) > > > > > > -- > > > 2.33.0 > > > I'm sorry for the delay in my response, but I think I can send a V3 soon, probably until next week. [3] - https://lwn.net/Articles/688216/ Cheers, -- Isabella Basso