From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB13BECAAD1 for ; Wed, 31 Aug 2022 17:30:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DEA556B0071; Wed, 31 Aug 2022 13:30:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D9AE16B0072; Wed, 31 Aug 2022 13:30:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C89018D0001; Wed, 31 Aug 2022 13:30:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id BB6046B0071 for ; Wed, 31 Aug 2022 13:30:27 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 783B1120F58 for ; Wed, 31 Aug 2022 17:30:27 +0000 (UTC) X-FDA: 79860576894.01.B680E84 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by imf16.hostedemail.com (Postfix) with ESMTP id B4C2318004A for ; Wed, 31 Aug 2022 17:30:25 +0000 (UTC) Date: Wed, 31 Aug 2022 13:30:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1661967023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=akPUYJQ75fwIwMQFIb22LwWbtwnw5UTZVlPBgEDeTMs=; b=vE3CF/hYHXAE/K4932q4ajXNld0qKiFjAcWoi7fiBYp/VCovZl1Zx/Bw+pURhB6ZWUguOM yEECHfCMBhWuOS+8pPpB6WgHDKJe+QP39AFR9pm6A02T9tr9GTZUhFMtmSYMptto4Yr//a Edg/I2CSqagd7R1KnuqkPz3zjkZJkHU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dmitry Vyukov Cc: Suren Baghdasaryan , akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz, hannes@cmpxchg.org, roman.gushchin@linux.dev, mgorman@suse.de, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, void@manifault.com, peterz@infradead.org, juri.lelli@redhat.com, ldufour@linux.ibm.com, peterx@redhat.com, david@redhat.com, axboe@kernel.dk, mcgrof@kernel.org, masahiroy@kernel.org, nathan@kernel.org, changbin.du@intel.com, ytcoode@gmail.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com, vschneid@redhat.com, cl@linux.com, penberg@kernel.org, iamjoonsoo.kim@lge.com, 42.hyeyoo@gmail.com, glider@google.com, elver@google.com, shakeelb@google.com, songmuchun@bytedance.com, arnd@arndb.de, jbaron@akamai.com, rientjes@google.com, minchan@google.com, kaleshsingh@google.com, kernel-team@android.com, linux-mm@kvack.org, iommu@lists.linux.dev, kasan-dev@googlegroups.com, io-uring@vger.kernel.org, linux-arch@vger.kernel.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 22/30] Code tagging based fault injection Message-ID: <20220831173010.wc5j3ycmfjx6ezfu@moria.home.lan> References: <20220830214919.53220-1-surenb@google.com> <20220830214919.53220-23-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="vE3CF/hY"; spf=pass (imf16.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661967026; a=rsa-sha256; cv=none; b=EahwxyL761Ww3fmhBJK4Oo26t4AphGLjKGjitiorQG6V1a24jRxrMFWpEZLc7acmkEEYTD YXTbltR4NleZs6AQCng0/rbJffNX76nRlSDWKpsTCHlcCQQ8G9/vRILHv08TUQtNg2Hzcq qLBNr2CQ2nNvmZIWUzH9PUKlYj0jgzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661967026; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=akPUYJQ75fwIwMQFIb22LwWbtwnw5UTZVlPBgEDeTMs=; b=JxtFqmiy6+sthpavlwVb9QMSVA06MFdhz8ljGT5fVE95478vdK9eepMo6+ULGvSDbIBLZi ouHlZ8EuUvZ9l6SxIMDf4JOw31MpoG4ERCtelHjw/H2vot/yrOHGwrLn3GNzPbenxk0/h5 U2FuAl1IiwQkpcvnnYlpVMKomXgY/kY= X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: B4C2318004A X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="vE3CF/hY"; spf=pass (imf16.hostedemail.com: domain of kent.overstreet@linux.dev designates 91.121.223.63 as permitted sender) smtp.mailfrom=kent.overstreet@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Stat-Signature: kuyyxqtszmo7pk3cfurh6epyexzfj8nz X-HE-Tag: 1661967025-686679 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Aug 31, 2022 at 12:37:14PM +0200, Dmitry Vyukov wrote: > On Tue, 30 Aug 2022 at 23:50, Suren Baghdasaryan wrote: > > > > From: Kent Overstreet > > > > This adds a new fault injection capability, based on code tagging. > > > > To use, simply insert somewhere in your code > > > > dynamic_fault("fault_class_name") > > > > and check whether it returns true - if so, inject the error. > > For example > > > > if (dynamic_fault("init")) > > return -EINVAL; > > Hi Suren, > > If this is going to be used by mainline kernel, it would be good to > integrate this with fail_nth systematic fault injection: > https://elixir.bootlin.com/linux/latest/source/lib/fault-inject.c#L109 > > Otherwise these dynamic sites won't be tested by testing systems doing > systematic fault injection testing. That's a discussion we need to have, yeah. We don't want two distinct fault injection frameworks, we'll have to have a discussion as to whether this is (or can be) better enough to make a switch worthwhile, and whether a compatibility interface is needed - or maybe there's enough distinct interesting bits in both to make merging plausible? The debugfs interface for this fault injection code is necessarily different from our existing fault injection - this gives you a fault injection point _per callsite_, which is huge - e.g. for filesystem testing what I need is to be able to enable fault injection points within a given module. I can do that easily with this, not with our current fault injection. I think the per-callsite fault injection points would also be pretty valuable for CONFIG_FAULT_INJECTION_USERCOPY, too. OTOH, existing kernel fault injection can filter based on task - this fault injection framework doesn't have that. Easy enough to add, though. Similar for the interval/probability/ratelimit stuff. fail_function is the odd one out, I'm not sure how that would fit into this model. Everything else I've seen I think fits into this model. Also, it sounds like you're more familiar with our existing fault injection than I am, so if I've misunderstood anything about what it can do please do correct me. Interestingly: I just discovered from reading the code that CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is a thing (hadn't before because it depends on !X86_64 - what?). That's cool, though.