From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbcHHOIQ (ORCPT ); Mon, 8 Aug 2016 10:08:16 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49506 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751736AbcHHOIP (ORCPT ); Mon, 8 Aug 2016 10:08:15 -0400 Subject: Re: [PATCH 10/10] fault injection: inject faults in new/rare callchains To: Akinobu Mita References: <1470236755-29844-1-git-send-email-vegard.nossum@oracle.com> <1470236755-29844-10-git-send-email-vegard.nossum@oracle.com> Cc: Peter Zijlstra , Ingo Molnar , LKML From: Vegard Nossum Message-ID: <57A8922B.70105@oracle.com> Date: Mon, 8 Aug 2016 16:07:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 08/08/2016 03:54 PM, Akinobu Mita wrote: > 2016-08-04 0:05 GMT+09:00 Vegard Nossum : >> Before this patch, fault injection uses a combination of randomness and >> frequency to determine where to inject faults. The problem with this is >> that code paths which are executed very rarely get proportional amounts >> of faults injected. >> >> A better heuristic is to look at the actual callchain leading up to the >> possible failure point; if we see a callchain that we've never seen up >> until this point, chances are it's a rare one and we should definitely >> inject a fault here (since we might not get the chance again later). >> >> This uses a probabilistic set structure (similar to a bloom filter) to >> determine whether we have seen a particular callchain before by hashing >> the stack trace and atomically testing/setting a bit corresponding to >> the current callchain. [...] >> +config FAULT_INJECTION_AT_NEW_CALLSITES >> + bool "Inject fault the first time at a new callsite" > > Isn't it better to make a run time configurable option instead of the > build option? I prefer a build option personally since it keeps the code simple (you don't have to dynamically allocate the bitmap of known callchains, for example). I figured most people using fault injection would enable the new option while still allowing others to keep the current behaviour if they really want to. If you prefer a run-time option I can submit a new version. Thanks, Vegard