Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181Ab1BDKtp (ORCPT ); Fri, 4 Feb 2011 05:49:45 -0500 Received: from mail-qy0-f174.google.com ([209.85.216.174]:33445 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750736Ab1BDKtm convert rfc822-to-8bit (ORCPT ); Fri, 4 Feb 2011 05:49:42 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=RWF0tXDXXnsfGA5z51shL1hMUyG+n4lN4zVoxLLHhUkTBD9DzznG09oPQXiJo4ui/8 Vyaq6q5wfh8uqx3DOI/BF1CSkcevDE17MolRHmzV1Kd7aqlIFOx34t7UH1oeBt+ZPuc6 4nEARme/cGbpJKgAZF0mnvvksLR/KpzQvr2qI= MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 4 Feb 2011 12:49:41 +0200 Message-ID: Subject: Re: [PATCH 0/5] net: sysctl: share ipv4/ipv6 sysctl tables From: Alexey Dobriyan To: Lucian Adrian Grijincu Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "Eric W. Biederman" , Eric Dumazet , "David S. Miller" , Octavian Purdila Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1992 Lines: 50 On Fri, Feb 4, 2011 at 6:37 AM, Lucian Adrian Grijincu wrote: > Each network device gets the same 25/24 sysctl entries for ipv4/ipv6 > in /proc/sys/net/ipv4/conf/DEVNAME and /proc/sys/net/ipv6/conf/DEVNAME > > Unfortunately, space is wasted holding very much similar data. > Fortunately, with some tricks these entries can be shared between all > network devices. > > > The single entry in 'struct ctl_table' that was modified at runtime > for leaf ctl_table nodes and prevented sharing was 'parent'. This > field was first introduces for selinux and then was used to implement > sysctl_check_table. Selinux recently removed the need for this field: > * http://thread.gmane.org/gmane.linux.kernel.lsm/12623 > * LKML-Reference: 1296519474-15714-1-git-send-email-lucian.grijincu@gmail.com > > > Remove the need for 'parent' in sysctl_check_table and remove the > 'parent' field: > > ?[PATCH 1/5] sysctl: faster reimplementation of sysctl_check_table > ?[PATCH 2/5] sysctl: remove useless ctl_table->parent field > > > Pave the way for sharing of ipv4/6 tables: allow data to be stored in > the nodes above the leafs that will be shared: > > ?[PATCH 3/5] sysctl: write ctl_table->extra2 to entries created from ctl_path > > > Finally share the leaf sysctl tables for ipv4/ipv6: > > ?[PATCH 4/5] ipv4: share sysctl net/ipv4/conf/DEVNAME/ tables > ?[PATCH 5/5] ipv6: share sysctl net/ipv6/conf/DEVNAME/ tables Meh. First you remove ->parent, then heroically pass "struct file *" to sysctl handlers which duplicates all information already passed and brings dcache into picture. Binary sysctl rewrite confused you into thinking that d_name.name is the way, but it isn't. For binary sysctl(2) you wouldn't get d_name.name. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/