From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 79CEB6B0009 for ; Thu, 26 Apr 2018 15:14:21 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id u127so4949083qka.9 for ; Thu, 26 Apr 2018 12:14:21 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id q12-v6si7818861qtk.125.2018.04.26.12.14.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 12:14:20 -0700 (PDT) Date: Thu, 26 Apr 2018 22:14:19 +0300 From: "Michael S. Tsirkin" Subject: Re: [dm-devel] [PATCH v5] fault-injection: introduce kvmalloc fallback options Message-ID: <20180426220523-mutt-send-email-mst@kernel.org> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Mikulas Patocka 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 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. 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. -- MST