Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp163970pxu; Thu, 7 Jan 2021 01:15:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkuQUTzFOvNlM7f5Gqvx6EAQsgzRnO8nf279R99lorqB7N33UC38m0T5orpFWx2UjJFnqF X-Received: by 2002:a17:906:b307:: with SMTP id n7mr5519334ejz.102.1610010951396; Thu, 07 Jan 2021 01:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610010951; cv=none; d=google.com; s=arc-20160816; b=D5efIIyPIKOea6D8ZksJ+e//7dxqtifj/LKA82KWhIMDsvGfsOuDdf/6qF11f9d6vc GEzBEKIjY10nZlbdBNx8pQwPvdMJrKCnz40NxKB8R24Vjiepb3lDS94TrT9rykuwj2Sn MbUOxxsj3dkpYHwJ4t3UGc7wCLp+qXHi3g2eqm2eFdioT42ELbnSTnoEQyDOBON7GH6O B8Tt7BoHboF+MEyPY5MNjTDlxU/NwW0zWtJAR/v/BnipiwfN+qa2AzcMmojgU+tzCn95 QwuTYuspbWTGs24qopXgMe4HjwMl0oSMDuVJhOl9necRY3hDcl//louTMAGJFvaRHDCu vnuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=hvwIoelUi1wx+za4I6FAa+/pn9VbnZdTGjdvOxoB1zU=; b=GAZ8rQLuKMKNpgaX6c+Uo6rssXVBgokJNFq/mRIAHLw3u+G/wokNwnUmmguVh1WiuE D+dbzI7U26rx+28935xvjmQgcBelIIvSs+FH4Of3CSjqipXPuyeiOy1f/b4b/YW9lauz HewoWft7ToVY5dVX/wtlC7O6+DYgICCOZ7PxUsbny0MS5fXZKOlAHtivi/Rm6CM6wCK3 RA6jbVYYzI2/Bdv604oNBAkmIsmUTBWN2ZhgKwTkujt5pev7y/y8Kh7Sww043vrIJLz3 sm3F9q45DiSffIE1wScPlOBgx0c4qeDOmmgaypfnXdq9dWDfjLk+nqH8HQPJD+hg0UxP P4JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=Y3+xzT7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p22si853089edt.391.2021.01.07.01.15.28; Thu, 07 Jan 2021 01:15:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=Y3+xzT7c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbhAGJO3 (ORCPT + 99 others); Thu, 7 Jan 2021 04:14:29 -0500 Received: from mail1.protonmail.ch ([185.70.40.18]:37366 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726862AbhAGJO2 (ORCPT ); Thu, 7 Jan 2021 04:14:28 -0500 Date: Thu, 07 Jan 2021 09:13:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610010826; bh=hvwIoelUi1wx+za4I6FAa+/pn9VbnZdTGjdvOxoB1zU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Y3+xzT7cHW/sNusbEjY8I4TqKzQszsQ7W6lvZv6YnOxGsezOcMfGYhuhpdn3kejN+ EzvCGyjX8hJEzXfyggRFglqAnLo8WjnnkOB0MlOl1TVghUW/66ovOGBFr+L9a7vQUA xCwEwngvOEhR++W5p+IVwC/ludLOiIOn+GVFyyKoUU+x8J5nPXYbnjymhZL8GFAEoh bGe9VlzdM4Wqcl/45Z+xyRzTE7r4iG+2/EJ3zF421XDEDxwx3aJ0M1DQiL2g9V7hO9 KnSqX5cWxOZdvL9yUcfDRqU03dCJDM0t3uvUKA/4wZmk78i/i02LgUK9fx+9Ke5/u9 c/ZAqI6rZ3pmg== To: Jakub Kicinski From: Alexander Lobakin Cc: Alexander Lobakin , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: Re: [PATCH net-next] net: sysctl: cleanup net_sysctl_init() Message-ID: <20210107091318.2184-1-alobakin@pm.me> In-Reply-To: <20210106163056.79d75ffa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> References: <20210106204014.34730-1-alobakin@pm.me> <20210106163056.79d75ffa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski Date: Wed, 6 Jan 2021 16:30:56 -0800 > On Wed, 06 Jan 2021 20:40:28 +0000 Alexander Lobakin wrote: >> 'net_header' is not used outside of this function, so can be moved >> from BSS onto the stack. >> Declarations of one-element arrays are discouraged, and there's no >> need to store 'empty' in BSS. Simply allocate it from heap at init. > > Are you sure? It's passed as an argument to register_sysctl() > so it may well need to be valid for the lifetime of net_header. I just moved it from BSS to the heap and allocate it using kzalloc(), it's still valid through the lifetime of the kernel. Al