Received: by 10.192.165.148 with SMTP id m20csp4860061imm; Tue, 24 Apr 2018 09:30:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+DU89NOTT+qScC7ho7TF7N/ULxvDIw8g2b26PFgDWoujcnngoDY5RfESPg4o6wwS/2qICJ X-Received: by 2002:a17:902:8601:: with SMTP id f1-v6mr24865978plo.220.1524587441500; Tue, 24 Apr 2018 09:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524587441; cv=none; d=google.com; s=arc-20160816; b=eE4qOfi55dxTb4UpQ+faYe+hlrhDfdivBc6hy+lXWYp+vaw3npvzRsWuB3nPAuVYrw iUC4uLiI6xBxtZGbLyc2IdgR7cn5RseTGiP+xTG0TM2XQzpeoN6uYp91KkQqSmj9uiLm OtJKGfMebXMknNb7FaWYVa7yKF1PtwAs15RHuXuO/nOQBFewaqISXgtVyVCOhheDnlvu qekl6ZnkHAaSvCXxMKYagnvjJKZFwdcbEH1ZNS4emHzz1zjtSPnQE0XdYQOWgpEu7xZE fQYt2OTj50g99phoNz7JJ/faQ/3UvWIejqPGsj44MtRNCr7YYOrdsvyqjQmJXqy9bAnu qtCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=709jbS2A0WZzn2Ca5yngdL7vu5GigenKEOptT62QhRU=; b=Io8bzJVqW+x9yNsTG5z85VCE2fYsMHEMnGc7tKrUhutYzWdQ8ni9cFrNN8EiaOkCHS pzvAwbbqF6WeQG5kqBGfWZjN2xKLGUH6GP0Dy9B/qA/PPaBV/pyAY3s72f1gc3qHajlZ hWPXuWJweLI2ub2IOl47mNVrX3kDsinb6szIgTLWpOHnrSjUFzVsIx4P6Ul0QCW+FjPz yKYswfW1wcEanytI4rnEWqZCUyhwbk/JOjzvnkMpdxXIfJss8tjcub9VjGj9pib0VMhq TXRhZt7LnbbJpQKhazgrvtAbZgHEWFBz0G40rVW/We0n9EDO9lz9SDhBMmINJQSfWm5X pFQQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si8646321pge.639.2018.04.24.09.30.26; Tue, 24 Apr 2018 09:30:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751535AbeDXQ3R (ORCPT + 99 others); Tue, 24 Apr 2018 12:29:17 -0400 Received: from mx2.suse.de ([195.135.220.15]:41093 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbeDXQ3N (ORCPT ); Tue, 24 Apr 2018 12:29:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D9C54AF39; Tue, 24 Apr 2018 16:29:10 +0000 (UTC) Date: Tue, 24 Apr 2018 10:29:06 -0600 From: Michal Hocko To: Mikulas Patocka Cc: Matthew Wilcox , David Miller , Andrew Morton , linux-mm@kvack.org, eric.dumazet@gmail.com, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, dm-devel@redhat.com, Vlastimil Babka Subject: Re: [PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG Message-ID: <20180424162906.GM17484@dhcp22.suse.cz> References: <20180420130852.GC16083@dhcp22.suse.cz> <20180420210200.GH10788@bombadil.infradead.org> <20180421144757.GC14610@bombadil.infradead.org> <20180423151545.GU17484@dhcp22.suse.cz> <20180424125121.GA17484@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 24-04-18 11:50:30, Mikulas Patocka wrote: > > > On Tue, 24 Apr 2018, Michal Hocko wrote: > > > On Mon 23-04-18 20:06:16, Mikulas Patocka wrote: > > [...] > > > @@ -404,6 +405,12 @@ void *kvmalloc_node(size_t size, gfp_t f > > > */ > > > WARN_ON_ONCE((flags & GFP_KERNEL) != GFP_KERNEL); > > > > > > +#ifdef CONFIG_DEBUG_SG > > > + /* Catch bugs when the caller uses DMA API on the result of kvmalloc. */ > > > + if (!(prandom_u32_max(2) & 1)) > > > + goto do_vmalloc; > > > +#endif > > > > I really do not think there is anything DEBUG_SG specific here. Why you > > simply do not follow should_failslab path or even reuse the function? > > CONFIG_DEBUG_SG is enabled by default in RHEL and Fedora debug kernel (if > you don't like CONFIG_DEBUG_SG, pick any other option that is enabled > there). Are you telling me that you are shaping a debugging functionality basing on what RHEL has enabled? And you call me evil. This is just rediculous. > Fail-injection framework is if off by default and it must be explicitly > enabled and configured by the user - and most users won't enable it. It can be enabled easily. And if you care enough for your debugging kernel then just make it enabled unconditionally. -- Michal Hocko SUSE Labs