Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp664571yba; Mon, 1 Apr 2019 14:13:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPSE06fu5GdED2DpRPKr2dcHoYWrH2HXuHeuEdQy9dVH7tgZM+JajsXd03tXB0FIuJMVxq X-Received: by 2002:aa7:8c84:: with SMTP id p4mr26155299pfd.164.1554153223424; Mon, 01 Apr 2019 14:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554153223; cv=none; d=google.com; s=arc-20160816; b=QmTF2QPKaAWX9nKF3/Y5zQ9pk354S1AU7gLpb/4KMPNHJyioDWEvjvwX42WSD66SIN blX8jKu6b4ntPlugD9PR5XWcpeIz55yc6C0+ayWo3vVQ7CCzIGw+iGmVFyE6VJN+S8JU Ctn0n7XNyqz6tE8XfEMhi85Sn9geuc17KqNYGK49MS/gbrLwtTVjgLxIwZbSyWS2+aYY YLNuM9mQflHhFH0GQMLJnoRjvUoI8KdWi4kJf9omSnO83ymuatrDwejtOLh0SsLIJMmk ZIpvO+dQzp7QyyWod1wSkmnAuSGop4TKmLwbguXgNw79wHpzoB6g+p2YjS0FLY7f/01z drtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=my+8kMrogBOyXJrCZPeMJC88daxVsQMYdE+rBltktwg=; b=nciteoVpPZP/CbiohqaATB4l5p7G9UqlyWcfE/qaGFmEuVMFnj+bcuxAcSkKvHd798 hP63BjYRGuWLj0H/yCjcTYV1mTdsqrdc18dvZyZ82vr66qPaOsgEcXavU05ty+DWmLx3 +SI7oPMG4fXWDr/0h6nfHZ+GHhiKJkk8YEau8AzMRwQ0u6xK2QPOZY0NH959eLJ/+8z5 5W8ygb3g9myGbsT5xfjVRxX7K9yJyEwpiTYCHhDNjDL3FLffP0r1QJJpkeo1JS4IEmwZ NlHveLRDijbhFZDpMRs9ZBWr0wRhI1xACFk7OUKWKyxuGlvtb1NpKg3EP5qSP5XuZfwe Tgjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j488x6ti; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si9284661pgq.439.2019.04.01.14.13.27; Mon, 01 Apr 2019 14:13:43 -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; dkim=pass header.i=@chromium.org header.s=google header.b=j488x6ti; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728587AbfDAVMg (ORCPT + 99 others); Mon, 1 Apr 2019 17:12:36 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39925 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726690AbfDAVMg (ORCPT ); Mon, 1 Apr 2019 17:12:36 -0400 Received: by mail-ot1-f65.google.com with SMTP id f10so2425778otb.6 for ; Mon, 01 Apr 2019 14:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=my+8kMrogBOyXJrCZPeMJC88daxVsQMYdE+rBltktwg=; b=j488x6tiM97EhXQc/V0QqchABBaTyH78NFyaCmrkFem7gAtMk15wihd5zSYn+QTzWL jCP8ef69w+NtciWMP0rB++VuHdApxi4cByB8/wn71c8/SOi+m57mLTVLF4UhqYGDLvwd 4FBtacF/J8ZJlR2ykZ7YF+FMN2YqPd/Pm7ZCs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=my+8kMrogBOyXJrCZPeMJC88daxVsQMYdE+rBltktwg=; b=i0qgvmVKh/n13dV0E4YLVUXXlAQrdOqL2jmIYQyLU0/qoKzuv1oCz2OkKmW9DaroZ8 chVVe1Sijk4Adu1L2ojRfFCdKWeert/3Hs69/quGV0i/03HUjdIbO/TblAiGTzlnuWPG LdVCT7D7YzD/7xV0DaABodXnSgT0zNgHdRYlIaPzwbfXG6EjZAlRh706ShI134v1v+1m xOFdO11+ofDs7hymHylP6gl3M4HkjpDdYLOm4HO3oVgFimYmW8Yarlo5OvozeNiHX1kW Wkp92UwMpq6Qnkq9ckOARCYrgI2n//G2fg1DbVJtSjJkZRJ4vVsJ+deqZGvFoQdufl66 S8IA== X-Gm-Message-State: APjAAAX4TrFXkVf6ZYPmOF5KKOWzaLoi1UjlDlS9oAYs6Kuj2E7Hvec4 p4Ohxb6mFxZ2daoEWvraIXAxZyiQu3s= X-Received: by 2002:a9d:694e:: with SMTP id p14mr21956201oto.193.1554153155426; Mon, 01 Apr 2019 14:12:35 -0700 (PDT) Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com. [209.85.167.172]) by smtp.gmail.com with ESMTPSA id i17sm4505438otc.67.2019.04.01.14.12.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 14:12:35 -0700 (PDT) Received: by mail-oi1-f172.google.com with SMTP id 3so8600687oir.7 for ; Mon, 01 Apr 2019 14:12:34 -0700 (PDT) X-Received: by 2002:aca:3905:: with SMTP id g5mr9847863oia.49.1554153154276; Mon, 01 Apr 2019 14:12:34 -0700 (PDT) MIME-Version: 1.0 References: <5d7229de06286b4ec06daee3411e39e9b638d66c.camel@perches.com> In-Reply-To: <5d7229de06286b4ec06daee3411e39e9b638d66c.camel@perches.com> From: Nick Crews Date: Mon, 1 Apr 2019 15:12:23 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] coding-style.rst: Generic alloc functions do not need OOM logging To: Joe Perches Cc: Jonathan Corbet , LKML , linux-doc Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Joe, this is a great detail to add. On Sat, Mar 30, 2019 at 11:25 AM Joe Perches wrote: > > Generic allocation functions already emit a dump_stack() > so additional error logging isn't useful. > > Document it as such and add a reference to the allocation > API. > > Signed-off-by: Joe Perches > --- > Documentation/process/coding-style.rst | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst > index 8ea913e99fa1..fa864a51e6ea 100644 > --- a/Documentation/process/coding-style.rst > +++ b/Documentation/process/coding-style.rst > @@ -843,7 +843,8 @@ used. > The kernel provides the following general purpose memory allocators: > kmalloc(), kzalloc(), kmalloc_array(), kcalloc(), vmalloc(), and > vzalloc(). Please refer to the API documentation for further information > -about them. > +about them. :ref:`Documentation/core-api/memory-allocation.rst > +` > > The preferred form for passing a size of a struct is the following: > > @@ -874,6 +875,9 @@ The preferred form for allocating a zeroed array is the following: > Both forms check for overflow on the allocation size n * sizeof(...), > and return NULL if that occurred. > > +These generic allocation functions all emit a stack dump on failure when used > +without __GFP_NOWARN so there is no use in emitting an additional failure > +message when NULL is returned. > > 15) The inline disease > ---------------------- > Acked-by: Nick Crews