Received: by 10.192.165.148 with SMTP id m20csp2532249imm; Thu, 26 Apr 2018 12:37:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/bPH1gS/seEAFjL5XnHtrH5F0/KgEVZ6cdQp/e+5B0vPgFX+/v8l3D4e1CHJiIh0i28LJT X-Received: by 10.99.105.195 with SMTP id e186mr18816374pgc.353.1524771468814; Thu, 26 Apr 2018 12:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524771468; cv=none; d=google.com; s=arc-20160816; b=HKMufgASit1r2kVqluKycF7zlmCN4h65onZHIHLRZeo4Ue3tSQUcOimZg1WmkPaJne iQKoxF2MCi64Imic20GPTH7D6mmTaPJ6Uw7OyDE/DiRlo5srwPwVWU9CLcTJWzGiHUrb AhfMd5TUwzYU1CZaXD7PEiUf2OIS32Ysil3Hue2ht33yaMjrVf2p2/TTbu/Si+8v937D fjogfRoAJiDo+LlgQeQRC84VfZsiKK/dbQ8fR8KZCobwqf+9UWF+FRQCpmN7HfnCmY/w +X+3yK6oufoIuyd/Tcq6aoNJ8jtIbb+UFvrCA+85Ls7ECMAeJ1Qb21swUH17XdF9T+UT BqeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=iEiFcB8CPb7LSZL9o5WC9YENQF6xKLZeJCMemWbQngE=; b=azz4Vo6QDvU6DhTqrQ4OvRbJFAVRTMi/CQSVfQwPsMaW+izFmgiF8QbPlLWYLDeuSC UgDHS37fh6ZaEfrdOAC4U2cepjXOmNwQ7+5/ZkSoc1JnuS9aiK2hrbAfe+2vZC/trB0n UiPzuYp+mu3lHYTEHNGakr2XaBVyqG+V2Xd/lI6l5awpAE/a8wnnYgKawlBWh5bEUe2i LYJrqKEiY5U+dMy/t/h6itX4l+9Ok7tl0RALqqare9d/M10KUGHks39eh9Q8a5inF/Hx WnAPcTwoIezhMnyz3EHzCQmVZk8AB/ub9aFkuoFL0jlp0KLFXvUsNj3BVx2X5Jr54j8C yt6A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si15982698pgn.471.2018.04.26.12.37.33; Thu, 26 Apr 2018 12:37:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754582AbeDZTgW (ORCPT + 99 others); Thu, 26 Apr 2018 15:36:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751933AbeDZTgU (ORCPT ); Thu, 26 Apr 2018 15:36:20 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B7EE40704AE; Thu, 26 Apr 2018 19:36:20 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1532010AF9D9; Thu, 26 Apr 2018 19:36:14 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w3QJaEF6032068; Thu, 26 Apr 2018 15:36:14 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w3QJaEgk032063; Thu, 26 Apr 2018 15:36:14 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Thu, 26 Apr 2018 15:36:14 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: "Michael S. Tsirkin" cc: James Bottomley , Michal Hocko , David Rientjes , dm-devel@redhat.com, eric.dumazet@gmail.com, netdev@vger.kernel.org, jasowang@redhat.com, Randy Dunlap , linux-kernel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, edumazet@google.com, Andrew Morton , virtualization@lists.linux-foundation.org, David Miller , Vlastimil Babka Subject: Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options In-Reply-To: <20180426220523-mutt-send-email-mst@kernel.org> Message-ID: References: <20180426125817.GO17484@dhcp22.suse.cz> <1524753932.3226.5.camel@HansenPartnership.com> <1524756256.3226.7.camel@HansenPartnership.com> <20180426184845-mutt-send-email-mst@kernel.org> <20180426214011-mutt-send-email-mst@kernel.org> <20180426220523-mutt-send-email-mst@kernel.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 26 Apr 2018 19:36:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 26 Apr 2018 19:36:20 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > On Thu, Apr 26, 2018 at 02:54:26PM -0400, Mikulas Patocka wrote: > > > > > > On Thu, 26 Apr 2018, Michael S. Tsirkin wrote: > > > > > On Thu, Apr 26, 2018 at 12:07:25PM -0400, Mikulas Patocka wrote: > > > > > IIUC debug kernels mainly exist so people who experience e.g. memory > > > > > corruption can try and debug the failure. In this case, CONFIG_DEBUG_SG > > > > > will *already* catch a failure early. Nothing special needs to be done. > > > > > > > > The patch helps people debug such memory coprruptions (such as using DMA > > > > API on the result of kvmalloc). > > > > > > That's my point. I don't think your patch helps debug any memory > > > corruptions. With CONFIG_DEBUG_SG using DMA API already causes a > > > BUG_ON, that's before any memory can get corrupted. > > > > The patch turns a hard-to-reproduce bug into an easy-to-reproduce bug. > > It's still not a memory corruption. It's a BUG_ON the source of which - > should it trigger - can be typically found using grep. > > > Obviously we don't want this in production kernels, but in the debug > > kernels it should be done. > > > > Mikulas > > I'm not so sure. debug kernels should make debugging easier, > definitely. > > Unfortunately they are already slower so some races don't trigger. > > If they also start crashing more because we are injecting > memory allocation errors, people are even less likely to > be able to use them. I've actually already pushed this patch to RHEL-7 (just before 7.5 was released) and it found out some powerpc issues. See the commit ea376cc55bc3 in the RHEL-7 git. It was reverted just before RHEL-7.5 was released with the intention that it will be reinstated just after RHEL-7.5 release, so that these issues could be found and eliminated in the 7.5->7.6 development cycle. Jeff Moyer asked me to put it upstream because they want to follow upstream and they don't like RHEL-specific patches. There's clear incentive to put this patch to RHEL-7, that's why I'm posting it here. > Just add a comment near the BUG_ON within DMA API telling people how > they can inject this error some more if the bug does not > reproduce, and leave it at that. But the problem is that the powerpc bug only triggers with this patch. It doesn't trigger without it. So, we have a potential random-crashing bug in the codebase (and perhaps more others) and we want to eliminate them - that's why we need the patch. People on this list argue "this should be a kernel parameter". But the testers won't enable the kernel parameter, the crashes won't happen without the kernel parameter and the bugs will stay unreported and uncorrected. That's why it needs to be the default. Mikulas