Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp247383pxf; Wed, 17 Mar 2021 04:28:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq1rhcKzmlOsQ8tCXFgkSP60Xkxmuf9xIAhxcsAlGyNfs6tkmELZApVnqYEukgArAcn/u3 X-Received: by 2002:a17:906:311a:: with SMTP id 26mr34535192ejx.395.1615980525777; Wed, 17 Mar 2021 04:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615980525; cv=none; d=google.com; s=arc-20160816; b=gkQGQ54xhiApcYEEKfPgNR1i4TLKqtLNlr6Oiqp46yWY7AK5uM6HhmjhOUSH3YTaDu L8cvglnXvaL3MHgZUz79gzmQV5iWQtbEqIdh2VjQg0trSE+ZcrhPN3aRTSiBwHGrhseb hMw9K+qOgjRYuTzWS090aCP4ahqgW17hg9whSK8tJ9ZOd436hXcmIEbazEtiSFbMfyMY mIJHb7sw0z0QLWduBZ/pZRCX8tBxRVUTH2/KgBSez69+FxBhLxH9ZD1khLQbxhUQY2t8 bZEYWBEt3rdeS+nQ+E1jH7DjB/5WVbQV8xjuwCf1UiHEnygMtdW1lOETtK25/2IA7O9E c7Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=tQX5SWEXwjLL2Zmx8EITApcXbeExg6yE9/rS3tVg/4s=; b=ZavDCXMIrDFzpCCcLDGor5IEo4rwwyvmpOL1wBlSM/AIwjTYr3Xm25Qdzy0RNSvqp3 qgM2s4zAYfWZir84MvoBH1ytJhOG/8EmDcF2uH+xtK+dPfMHSmKFWu4tzH6pGxHlR6o6 LE33EdFhHO4sJ1OPDxK5VFNfpkSt6vEUq+/6pWe/4oiBo3cIMh2ZCZKyLwZ1nmhO/xMO GTCFSIt5hspU6X79uveTaKahhF+Iz6fAA8Koa7zqRdgllHZ5DPC0nCxQb4/fejW80lZJ pgMfbuKc40s08PTpzp4oXigANV/dN0EVbTTFUab4mIaLrhbu1lT7Fam2OsyA1OJVBI99 KENw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si15868152ejy.135.2021.03.17.04.28.23; Wed, 17 Mar 2021 04:28:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231233AbhCQLZK (ORCPT + 99 others); Wed, 17 Mar 2021 07:25:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:42288 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbhCQLZB (ORCPT ); Wed, 17 Mar 2021 07:25:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AB608AB8C; Wed, 17 Mar 2021 11:24:59 +0000 (UTC) Subject: Re: [PATCH 1/2] selftests: add a kselftest for SLUB debugging functionality To: glittao@gmail.com, cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org References: <20210316124118.6874-1-glittao@gmail.com> From: Vlastimil Babka Message-ID: Date: Wed, 17 Mar 2021 12:24:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210316124118.6874-1-glittao@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/16/21 1:41 PM, glittao@gmail.com wrote: > From: Oliver Glitta > > SLUB has resiliency_test() function which is hidden behind #ifdef > SLUB_RESILIENCY_TEST that is not part of Kconfig, so nobody > runs it. Kselftest should proper replacement for it. > > Try changing byte in redzone after allocation and changing > pointer to next free node, first byte, 50th byte and redzone > byte. Check if validation finds errors. > > There are several differences from the original resiliency test: > Tests create own caches with known state instead of corrupting > shared kmalloc caches. > > The corruption of freepointer uses correct offset, the original > resiliency test got broken with freepointer changes. > > Scratch changing random byte test, because it does not have > meaning in this form where we need deterministic results. > > Add new option CONFIG_TEST_SLUB in Kconfig. > > Add parameter to function validate_slab_cache() to return > number of errors in cache. > > Signed-off-by: Oliver Glitta Acked-by: Vlastimil Babka Disclaimer: this is done as part of Oliver's university project that I'm advising.