Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] Remove netpoll blocking from uninit path
From: David Miller @ 2010-10-20  8:45 UTC (permalink / raw)
  To: amwang; +Cc: nhorman, netdev, bonding-devel, fubar, andy
In-Reply-To: <4CBE9E7F.60107@redhat.com>

From: Cong Wang <amwang@redhat.com>
Date: Wed, 20 Oct 2010 15:47:11 +0800

> On 10/20/10 01:04, nhorman@tuxdriver.com wrote:
>> From: Neil Horman<nhorman@tuxdriver.com>
>>
>> Some recent testing in netpoll with bonding showed this backtrace
...
>> Signed-off-by: Neil Horman<nhorman@tuxdriver.com>
> 
> Reviewed-by: WANG Cong <amwang@redhat.com>

Applied.

Neil, please add proper subsystem prefixes to your subject
lines, I've had to add them by hand as I add your patches.

Thanks.

^ permalink raw reply

* Re: [RFC PATCH 1/9] ipvs network name space aware
From: Hans Schillstrom @ 2010-10-20  8:25 UTC (permalink / raw)
  To: paulmck@linux.vnet.ibm.com
  Cc: Daniel Lezcano, lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, horms@verge.net.au, ja@ssi.bg,
	wensong@linux-vs.org
In-Reply-To: <20101019184436.GG2362@linux.vnet.ibm.com>

On Tuesday 19 October 2010 20:44:36 Paul E. McKenney wrote:
> On Mon, Oct 18, 2010 at 03:23:48PM +0200, Hans Schillstrom wrote:
> > On Monday 18 October 2010 13:37:38 Daniel Lezcano wrote:
> > > On 10/18/2010 11:54 AM, Hans Schillstrom wrote:
> > > > On Monday 18 October 2010 10:59:25 Daniel Lezcano wrote:
> > > >
> > > >> On 10/08/2010 01:16 PM, Hans Schillstrom wrote:
> > > >>
> > > >>> This part contains the include files
> > > >>> where include/net/netns/ip_vs.h is new and contains all moved vars.
> > > >>>
> > > >>> SUMMARY
> > > >>>
> > > >>>    include/net/ip_vs.h                     |  136 ++++---
> > > >>>    include/net/net_namespace.h             |    2 +
> > > >>>    include/net/netns/ip_vs.h               |  112 +++++
> > > >>>
> > > >>> Signed-off-by:Hans Schillstrom<hans.schillstrom@ericsson.com>
> > > >>> ---
> > > >>>
> > > >>>
> > > >>>
> > > >> [ ... ]
> > > >>
> > > >>
> > > >>>    #ifdef CONFIG_IP_VS_IPV6
> > > >>> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> > > >>> index bd10a79..b59cdc5 100644
> > > >>> --- a/include/net/net_namespace.h
> > > >>> +++ b/include/net/net_namespace.h
> > > >>> @@ -15,6 +15,7 @@
> > > >>>    #include<net/netns/ipv4.h>
> > > >>>    #include<net/netns/ipv6.h>
> > > >>>    #include<net/netns/dccp.h>
> > > >>> +#include<net/netns/ip_vs.h>
> > > >>>    #include<net/netns/x_tables.h>
> > > >>>    #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
> > > >>>    #include<net/netns/conntrack.h>
> > > >>> @@ -91,6 +92,7 @@ struct net {
> > > >>>    	struct sk_buff_head	wext_nlevents;
> > > >>>    #endif
> > > >>>    	struct net_generic	*gen;
> > > >>> +	struct netns_ipvs       *ipvs;
> > > >>>    };
> > > >>>
> > > >>>
> > > >> IMHO, it would be better to use the net_generic infra-structure instead
> > > >> of adding a new field in the netns structure.
> > > >>
> > > >>
> > > >>
> > > > I realized that to, but the performance penalty is quite high with net_generic :-(
> > > > But on the other hand if you are going to backport it, (without recompiling the kernel)
> > > > you gonna need it!
> > > >
> > >
> > > Hmm, yes. We don't want to have the init_net_ns performances to be impacted.
> > >
> > > You use here a pointer which will be dereferenced like the net_generic,
> > > I don't think there will be
> > > a big difference between using net_generic and using a pointer in the
> > > net namespace structure.
> > >
> > > The difference is the id usage, but this one is based on the idr which
> > > is quite fast.
> > >
> >
> > I'm not so sure about that, have a look at net_generic and rcu_read_lock
> > and compare
> >  ipvs = net->ipvs;
> > vs.
> >  ipvs = net_generic(net, id)
> >
> > static inline void *net_generic(struct net *net, int id)
> > {
> > 	struct net_generic *ng;
> > 	void *ptr;
> >
> > 	rcu_read_lock();
> > 	ng = rcu_dereference(net->gen);
> > 	BUG_ON(id == 0 || id > ng->len);
> > 	ptr = ng->ptr[id - 1];
> > 	rcu_read_unlock();
> >
> > 	return ptr;
> > }
> > ...
> > static inline void rcu_read_lock(void)
> > {
> >         __rcu_read_lock();
> >         __acquire(RCU);
> >         rcu_read_acquire();
> > }
> >
> > Another way of doing it is to pass the ipvs ptr instead of the net ptr,
> > and add *net to the ipvs struct.
> >
> > > We should experiment a bit here to compare both solutions.
> > Agre
> > >
> > I single stepped through the rcu_read_lock() on a x86_64
> > and it's quite many "stepi" that you need to enter :-(
>
> Was this by chance with lockdep enabled?  If not, could you please send
> your .config?
>
> 							Thanx, Paul

No lockdep, but what I ment is that net_generic is not as fast as a plain ptr->xxx.
IPVS has hooks in the netfilter chain, and gets a huge amount of packets .

I don't think IPVS is a candidate for net_generic, it should have its own part in "struct net"
That was my point.
( No critic to locking or net_generic)

--
Regards
Hans Schillstrom <hans.schillstrom@ericsson.com>

^ permalink raw reply

* [PATCH] phonet: remove the unused variable pn
From: Changli Gao @ 2010-10-20  7:51 UTC (permalink / raw)
  To: Remi Denis-Courmont; +Cc: David S. Miller, netdev, Changli Gao

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/phonet/pep.c |    1 -
 1 file changed, 1 deletion(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index 9c903f9..3e60f2e 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -300,7 +300,6 @@ static int pipe_handler_send_ind(struct sock *sk, u8 utid, u8 msg_id)
 
 static int pipe_handler_enable_pipe(struct sock *sk, int enable)
 {
-	struct pep_sock *pn = pep_sk(sk);
 	int utid, req;
 
 	if (enable) {

^ permalink raw reply related

* Re: [PATCH 2/2] Revert napi_poll fix for bonding driver
From: Cong Wang @ 2010-10-20  7:52 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, bonding-devel, fubar, davem, andy
In-Reply-To: <1287507866-25156-3-git-send-email-nhorman@tuxdriver.com>

On 10/20/10 01:04, nhorman@tuxdriver.com wrote:
> From: Neil Horman<nhorman@tuxdriver.com>
>
> In an erlier patch I modified napi_poll so that devices with IFF_MASTER polled
> the per_cpu list instead of the device list for napi.  I did this because the
> bonding driver has no napi instances to poll, it instead expects to check the
> slave devices napi instances, which napi_poll was unaware of.  Looking at this
> more closely however, I now see this isn't strictly needed.  As the bond driver
> poll_controller calls the slaves poll_controller via netpoll_poll_dev, which
> recursively calls poll_napi on each slave, allowing those napi instances to get
> serviced.  The earlier patch isn't at all harmfull, its just not needed, so lets
> revert it to make the code cleaner.  Sorry for the noise,
>
> Signed-off-by: Neil Horman<nhorman@tuxdriver.com>

Looks reasonable to me,

Reviewed-by: WANG Cong <amwang@redhat.com>

Thanks.

^ permalink raw reply

* Re: [PATCH 1/2] Remove netpoll blocking from uninit path
From: Cong Wang @ 2010-10-20  7:47 UTC (permalink / raw)
  To: nhorman; +Cc: netdev, bonding-devel, fubar, davem, andy
In-Reply-To: <1287507866-25156-2-git-send-email-nhorman@tuxdriver.com>

On 10/20/10 01:04, nhorman@tuxdriver.com wrote:
> From: Neil Horman<nhorman@tuxdriver.com>
>
> Some recent testing in netpoll with bonding showed this backtrace
>
>   ------------[ cut here ]------------
>   kernel BUG at drivers/net/bonding/bonding.h:134!
>   invalid opcode: 0000 [#1] SMP
>   last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb7/devnum
>   CPU 0
>   Pid: 1876, comm: rmmod Not tainted 2.6.36-rc3+ #10 D26928/
>   RIP: 0010:[<ffffffffa0514ba4>]  [<ffffffffa0514ba4>] bond_uninit+0x6f4/0x7a0
>   RSP: 0018:ffff88003b1b5d58  EFLAGS: 00010296
>   RAX: ffff88003b9b6200 RBX: ffff8800373e8e00 RCX: 00000000000f4240
>   RDX: 00000000ffffffff RSI: 0000000000000286 RDI: 0000000000000286
>   RBP: ffff88003b1b5dc8 R08: 0000000000000000 R09: 00000001af7de920
>   R10: 0000000000000000 R11: ffff880002495e98 R12: ffff880037922700
>   R13: ffff880038c31000 R14: ffff880037922730 R15: 0000000000000286
>   FS:  00007f90e6d72700(0000) GS:ffff880002400000(0000) knlGS:0000000000000000
>   CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
>   CR2: 000000346f0d9ad0 CR3: 000000003b263000 CR4: 00000000000006f0
>   DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>   DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
>   Process rmmod (pid: 1876, threadinfo ffff88003b1b4000, task ffff88003b36aa80)
>   Stack:
>   00000000ffffffff ffff88003b1b5d7a ffff8800379221e8 ffff880037922000
>   <0>  ffff88003b1b5dc8 ffffffff813eb5fb ffff88003b1b5da8 0000000031b177a3
>   <0>  ffff88003b1b5da8 ffff880037922000 ffff88003b1b5e48 ffff88003b1b5e48
>   Call Trace:
>   [<ffffffff813eb5fb>] ? rtmsg_ifinfo+0xcb/0xf0
>   [<ffffffff813daad8>] rollback_registered_many+0x168/0x280
>   [<ffffffff813dac09>] unregister_netdevice_many+0x19/0x80
>   [<ffffffff813e97b3>] __rtnl_kill_links+0x63/0x90
>   [<ffffffff813e980b>] __rtnl_link_unregister+0x2b/0x60
>   [<ffffffff813e9bde>] rtnl_link_unregister+0x1e/0x30
>   [<ffffffffa052124b>] bonding_exit+0x37/0x51 [bonding]
>   [<ffffffff81098b2e>] sys_delete_module+0x19e/0x270
>   [<ffffffff810bb2b2>] ? audit_syscall_entry+0x252/0x280
>   [<ffffffff8100b0b2>] system_call_fastpath+0x16/0x1b
>   RIP  [<ffffffffa0514ba4>] bond_uninit+0x6f4/0x7a0 [bonding]
>   RSP<ffff88003b1b5d58>
>   ---[ end trace 1395ad691cea24d1 ]---
>
> It occurs because of my recent netpoll blocking patches, which I added to avoid
> recursive deadlock in the bonding driver.  It relies on some per cpu bits, but
> the shutdown path forces some rescheduling as we cancel workqueues for the
> driver and wait for some device refcounts.  If after the forced reschedule, we
> wind up on a different cpu we trigger the bughalt in unblock_netpoll_tx.
>
> The fix is to remove the netpoll block/unblock calls from bond_release_all.
> This is safe to do because bond_uninit, which is called via ndo_uninit in
> rollback_registered_many, doesn't occur until we send a NETDEV_UNREGISTER event,
> which triggers netconsole to remove us as a netpoll client, so we are guaranteed
> not to recurse into our own tx path here.

Also bond_release_all() is called after bond_netpoll_cleanup()
in bond_uninit().

>
> Signed-off-by: Neil Horman<nhorman@tuxdriver.com>

Reviewed-by: WANG Cong <amwang@redhat.com>

Thanks.

^ permalink raw reply

* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Arnd Bergmann @ 2010-10-20  6:50 UTC (permalink / raw)
  To: Dave Young
  Cc: Greg KH, Oliver Neukum, Valdis.Kletnieks, Dave Airlie, codalist,
	ksummit-2010-discuss, autofs, Jan Harkes, Samuel Ortiz, Jan Kara,
	Arnaldo Carvalho de Melo, netdev, Anders Larsen, linux-kernel,
	dri-devel, Bryan Schumaker, Christoph Hellwig, Petr Vandrovec,
	Mikulas Patocka, linux-fsdevel, Evgeniy Dushistov, Ingo Molnar,
	Andrew Hendry, linux-media
In-Reply-To: <AANLkTimRFxKT5p1K=Rd1MxXZymonx_t6rHKBhn=8CsW=@mail.gmail.com>

On Wednesday 20 October 2010, Dave Young wrote:
> be curious, why can't just fix the lock_kernel logic of i810? Fixing
> is too hard?
> 
> Find a i810 hardware should be possible, even if the hardware does not
> support SMP, can't we test the fix with preemption?

Yes, that should work too. My usual approach for removing the BKL without
having the hardware myself was to make locking stricter, i.e. replace
the BKL with a new spinlock or mutex. This way all the code would still
be serialized and if I did something wrong, lockdep would complain about
it, but there would be no risk of silent data corruption.

In case of i810, locking across DRM is rather complicated and there is no
way of doing this without making changes to other DRM code.

In fact, the only critical section that is actually protected by the BKL
are the few lines in i810_mmap_buffers. They look like they might not even
need the BKL to start with and we can just remove it even on SMP/PREEMPT,
except for perhaps the assignment to buf_priv->currently_mapped.
Someone who understands more about the driver than I do can probably figure
this out easily, but I couldn't come up with a way that doesn't risk
breaking in corner cases.

	Arnd

^ permalink raw reply

* Re: 2.6.36-rc7: net/bridge causes temporary network I/O lockups [2]
From: Herbert Xu @ 2010-10-20  6:16 UTC (permalink / raw)
  To: Patrick Ringl; +Cc: netdev, linux-kernel, bridge
In-Reply-To: <4CBCB014.9080108@freenet.de>

On Mon, Oct 18, 2010 at 10:37:40PM +0200, Patrick Ringl wrote:
>
> Anything else I could possibly provide? :-)

Yes, testing :)

First of all I'd like to rule out (or in) the IPv6 query code,
which is clearly generating a bogus packet (wrong payload_len).

So can you apply this patch and see if it makes the problem
go away? Please take packet dumps so we know that the IPv6 query
is no longer being sent.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index eb5b256..66f39d7 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -832,11 +832,6 @@ static void br_multicast_send_query(struct net_bridge *br,
 	br_group.proto = htons(ETH_P_IP);
 	__br_multicast_send_query(br, port, &br_group);
 
-#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
-	br_group.proto = htons(ETH_P_IPV6);
-	__br_multicast_send_query(br, port, &br_group);
-#endif
-
 	time = jiffies;
 	time += sent < br->multicast_startup_query_count ?
 		br->multicast_startup_query_interval :

^ permalink raw reply related

* Re: [PATCH] net: make ctl_path local and const
From: Changli Gao @ 2010-10-20  5:10 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andy Grover, linux-sctp, rds-devel, Pekka Savola (ipv6),
	linux-x25, dccp, bridge, James Morris, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel, Ralf Baechle <ralf
In-Reply-To: <1287550779.10409.620.camel@Joe-Laptop>

On Wed, Oct 20, 2010 at 12:59 PM, Joe Perches <joe@perches.com> wrote:
>
> Not using static requires the compiler to emit
> initialization code for any use of the routine
> that otherwise would only be done once.
>

If the code isn't performance critical, I think we can afford.
Otherwise, we have to reserve the memory used to save the static data,
if we don't specify it as initial data.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: [PATCH] net: make ctl_path local and const
From: Joe Perches @ 2010-10-20  4:59 UTC (permalink / raw)
  To: Changli Gao
  Cc: Andy Grover, James Morris, linux-sctp, rds-devel,
	Pekka Savola (ipv6), linux-x25, dccp, bridge, Andrew, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel
In-Reply-To: <AANLkTimGUB-+TTsje1kc3q9PyoB2jJdgCK2Z7n9u7N1J@mail.gmail.com>

On Wed, 2010-10-20 at 12:52 +0800, Changli Gao wrote:
> On Wed, Oct 20, 2010 at 11:28 AM, Joe Perches <joe@perches.com> wrote:
> > At least some objects are smaller with static.
> > $ size net/appletalk/sysctl_net_atalk.o.*
> >   text    data     bss     dec     hex filename
> >    324     236      48     608     260 net/appletalk/sysctl_net_atalk.o.withstatic
> >    344     236      48     628     274 net/appletalk/sysctl_net_atalk.o.withoutstatic
> I got the opposite result for the size of the whole kernel image with
> allyesconfig.
> original: 33531456
> patched: 33531424
> It seems random.

Not using static requires the compiler to emit
initialization code for any use of the routine
that otherwise would only be done once.

^ permalink raw reply

* Re: [PATCH] net: make ctl_path local and const
From: Changli Gao @ 2010-10-20  4:52 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andy Grover, linux-sctp, rds-devel, Pekka Savola (ipv6),
	linux-x25, dccp, bridge, James Morris, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel, Ralf Baechle <ralf
In-Reply-To: <1287545337.10409.602.camel@Joe-Laptop>

On Wed, Oct 20, 2010 at 11:28 AM, Joe Perches <joe@perches.com> wrote:
>
> At least some objects are smaller with static.
>
> $ size net/appletalk/sysctl_net_atalk.o.*
>   text    data     bss     dec     hex filename
>    324     236      48     608     260 net/appletalk/sysctl_net_atalk.o.withstatic
>    344     236      48     628     274 net/appletalk/sysctl_net_atalk.o.withoutstatic
>
>

I got the opposite result for the size of the whole kernel image with
allyesconfig.

original: 33531456
patched: 33531424

It seems random.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Dave Young @ 2010-10-20  4:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greg KH, Oliver Neukum, Valdis.Kletnieks, Dave Airlie, codalist,
	ksummit-2010-discuss, autofs, Jan Harkes, Samuel Ortiz, Jan Kara,
	Arnaldo Carvalho de Melo, netdev, Anders Larsen, linux-kernel,
	dri-devel, Bryan Schumaker, Christoph Hellwig, Petr Vandrovec,
	Mikulas Patocka, linux-fsdevel, Evgeniy Dushistov, Ingo Molnar,
	Andrew Hendry, linux-media
In-Reply-To: <201010192244.41913.arnd@arndb.de>

On Wed, Oct 20, 2010 at 4:44 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 19 October 2010 22:29:12 Greg KH wrote:
>> On Tue, Oct 19, 2010 at 09:40:47PM +0200, Oliver Neukum wrote:
>> > Am Dienstag, 19. Oktober 2010, 21:37:35 schrieb Greg KH:
>> > > > So no need to clean it up for multiprocessor support.
>> > > >
>> > > > http://download.intel.com/design/chipsets/datashts/29067602.pdf
>> > > > http://www.intel.com/design/chipsets/specupdt/29069403.pdf
>> > >
>> > > Great, we can just drop all calls to lock_kernel() and the like in the
>> > > driver and be done with it, right?
>> >
>> > No,
>> >
>> > you still need to switch off preemption.
>>
>> Hm, how would you do that from within a driver?
>
> I think this would do:
> ---
> drm/i810: remove SMP support and BKL
>
> The i810 and i815 chipsets supported by the i810 drm driver were not
> officially designed for SMP operation, so the big kernel lock is
> only required for kernel preemption. This disables the driver if
> preemption is enabled and removes all calls to lock_kernel in it.
>
> If you own an Acorp 6A815EPD mainboard with a i815 chipset and
> two Pentium-III sockets, and want to run recent kernels on it,
> tell me about it.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index b755301..e071bc8 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -73,8 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
>
>  config DRM_I810
>        tristate "Intel I810"
> -       # BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
> -       depends on DRM && AGP && AGP_INTEL && BKL
> +       # PREEMPT requires BKL support here, which was removed
> +       depends on DRM && AGP && AGP_INTEL && !PREEMPT

be curious, why can't just fix the lock_kernel logic of i810? Fixing
is too hard?

Find a i810 hardware should be possible, even if the hardware does not
support SMP, can't we test the fix with preemption?

-- 
Regards
dave

^ permalink raw reply

* Re: [PATCH] net: make ctl_path local and const
From: Joe Perches @ 2010-10-20  3:28 UTC (permalink / raw)
  To: Changli Gao
  Cc: Andy Grover, James Morris, linux-sctp, rds-devel,
	Pekka Savola (ipv6), linux-x25, dccp, bridge, Andrew, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel
In-Reply-To: <AANLkTi=pz4zYnnUSvb9FjVvCAURruHhJTz7pBKDi8Pdw@mail.gmail.com>

On Wed, 2010-10-20 at 11:10 +0800, Changli Gao wrote:
> On Wed, Oct 20, 2010 at 11:01 AM, Joe Perches <joe@perches.com> wrote:
> > On Wed, 2010-10-20 at 10:54 +0800, Changli Gao wrote:
> >> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> > []
> >> diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
> >> index 04e9c0d..b92f269 100644
> >> --- a/net/appletalk/sysctl_net_atalk.c
> >> +++ b/net/appletalk/sysctl_net_atalk.c
> >> @@ -42,16 +42,16 @@ static struct ctl_table atalk_table[] = {
> >>       { },
> >>  };
> >> -static struct ctl_path atalk_path[] = {
> >> -     { .procname = "net", },
> >> -     { .procname = "appletalk", },
> >> -     { }
> >> -};
> >> -
> >>  static struct ctl_table_header *atalk_table_header;
> >>
> >>  void atalk_register_sysctl(void)
> >>  {
> >> +     const struct ctl_path atalk_path[] = {
> > Shouldn't all of these be static const struct ?
> They needn't. And some variables are specified __net_initdata currently.

At least some objects are smaller with static.

$ size net/appletalk/sysctl_net_atalk.o.*
   text	   data	    bss	    dec	    hex	filename
    324	    236	     48	    608	    260	net/appletalk/sysctl_net_atalk.o.withstatic
    344	    236	     48	    628	    274	net/appletalk/sysctl_net_atalk.o.withoutstatic

^ permalink raw reply

* Re: [PATCH] net: make ctl_path local and const
From: Changli Gao @ 2010-10-20  3:10 UTC (permalink / raw)
  To: Joe Perches
  Cc: Andy Grover, linux-sctp, rds-devel, Pekka Savola (ipv6),
	linux-x25, dccp, bridge, James Morris, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel, Ralf Baechle <ralf
In-Reply-To: <1287543701.10409.599.camel@Joe-Laptop>

On Wed, Oct 20, 2010 at 11:01 AM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2010-10-20 at 10:54 +0800, Changli Gao wrote:
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> []
>> diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
>> index 04e9c0d..b92f269 100644
>> --- a/net/appletalk/sysctl_net_atalk.c
>> +++ b/net/appletalk/sysctl_net_atalk.c
>> @@ -42,16 +42,16 @@ static struct ctl_table atalk_table[] = {
>>       { },
>>  };
>>
>> -static struct ctl_path atalk_path[] = {
>> -     { .procname = "net", },
>> -     { .procname = "appletalk", },
>> -     { }
>> -};
>> -
>>  static struct ctl_table_header *atalk_table_header;
>>
>>  void atalk_register_sysctl(void)
>>  {
>> +     const struct ctl_path atalk_path[] = {
>
> Shouldn't all of these be static const struct ?
>
>

They needn't. And some variables are specified __net_initdata currently.

-- 
Regards,
Changli Gao(xiaosuo@gmail.com)

^ permalink raw reply

* Re: [PATCH] net: make ctl_path local and const
From: Joe Perches @ 2010-10-20  3:01 UTC (permalink / raw)
  To: Changli Gao
  Cc: Andy Grover, James Morris, linux-sctp, rds-devel,
	Pekka Savola (ipv6), linux-x25, dccp, bridge, Andrew, coreteam,
	Arnaldo Carvalho de Melo, Alexey Kuznetsov, Joerg Reuter,
	Sridhar Samudrala, Samuel Ortiz, Vlad Yasevich, netfilter,
	Remi Denis-Courmont, linux-hams, Hideaki YOSHIFUJI, netdev,
	linux-decnet-user, linux-kernel
In-Reply-To: <1287543276-4511-1-git-send-email-xiaosuo@gmail.com>

On Wed, 2010-10-20 at 10:54 +0800, Changli Gao wrote:
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
[]
> diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
> index 04e9c0d..b92f269 100644
> --- a/net/appletalk/sysctl_net_atalk.c
> +++ b/net/appletalk/sysctl_net_atalk.c
> @@ -42,16 +42,16 @@ static struct ctl_table atalk_table[] = {
>  	{ },
>  };
>  
> -static struct ctl_path atalk_path[] = {
> -	{ .procname = "net", },
> -	{ .procname = "appletalk", },
> -	{ }
> -};
> -
>  static struct ctl_table_header *atalk_table_header;
>  
>  void atalk_register_sysctl(void)
>  {
> +	const struct ctl_path atalk_path[] = {

Shouldn't all of these be static const struct ?

^ permalink raw reply

* [PATCH] net: make ctl_path local and const
From: Changli Gao @ 2010-10-20  2:54 UTC (permalink / raw)
  To: David S. Miller
  Cc: Arnaldo Carvalho de Melo, Joerg Reuter, Ralf Baechle,
	Stephen Hemminger, Alexey Kuznetsov, Pekka Savola (ipv6),
	James Morris, Hideaki YOSHIFUJI, Patrick McHardy, Samuel Ortiz,
	Remi Denis-Courmont, Andy Grover, Vlad Yasevich,
	Sridhar Samudrala, Andrew Hendry, linux-kernel, netdev,
	linux-hams, bridge, dccp, linux-decnet-user, netfilter-devel,
	netfilter, coreteam

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
---
 net/appletalk/sysctl_net_atalk.c        |   12 ++++++------
 net/ax25/sysctl_net_ax25.c              |   11 +++++------
 net/bridge/br_netfilter.c               |   13 +++++++------
 net/dccp/sysctl.c                       |   14 +++++++-------
 net/decnet/sysctl_net_decnet.c          |   12 ++++++------
 net/ipv4/devinet.c                      |   10 +++++-----
 net/ipv4/route.c                        |   25 ++++++++++++-------------
 net/ipx/sysctl_net_ipx.c                |   11 +++++------
 net/irda/irsysctl.c                     |   12 ++++++------
 net/llc/sysctl_net_llc.c                |   12 ++++++------
 net/netfilter/nf_conntrack_standalone.c |    9 ++++-----
 net/netfilter/nf_log.c                  |   15 +++++++--------
 net/netrom/sysctl_net_netrom.c          |   12 ++++++------
 net/phonet/sysctl.c                     |   12 ++++++------
 net/rds/ib_sysctl.c                     |   17 +++++++++--------
 net/rds/iw_sysctl.c                     |   17 +++++++++--------
 net/rds/sysctl.c                        |   16 ++++++++--------
 net/rose/sysctl_net_rose.c              |   12 ++++++------
 net/sctp/sysctl.c                       |   12 ++++++------
 net/unix/sysctl_net_unix.c              |   11 +++++------
 net/x25/sysctl_net_x25.c                |   12 ++++++------
 21 files changed, 137 insertions(+), 140 deletions(-)
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
index 04e9c0d..b92f269 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/net/appletalk/sysctl_net_atalk.c
@@ -42,16 +42,16 @@ static struct ctl_table atalk_table[] = {
 	{ },
 };
 
-static struct ctl_path atalk_path[] = {
-	{ .procname = "net", },
-	{ .procname = "appletalk", },
-	{ }
-};
-
 static struct ctl_table_header *atalk_table_header;
 
 void atalk_register_sysctl(void)
 {
+	const struct ctl_path atalk_path[] = {
+		{ .procname = "net", },
+		{ .procname = "appletalk", },
+		{ }
+	};
+
 	atalk_table_header = register_sysctl_paths(atalk_path, atalk_table);
 }
 
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index ebe0ef3..6d461ae 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -34,12 +34,6 @@ static struct ctl_table_header *ax25_table_header;
 static ctl_table *ax25_table;
 static int ax25_table_size;
 
-static struct ctl_path ax25_path[] = {
-	{ .procname = "net", },
-	{ .procname = "ax25", },
-	{ }
-};
-
 static const ctl_table ax25_param_table[] = {
 	{
 		.procname	= "ip_default_mode",
@@ -163,6 +157,11 @@ void ax25_register_sysctl(void)
 {
 	ax25_dev *ax25_dev;
 	int n, k;
+	const struct ctl_path ax25_path[] = {
+		{ .procname = "net", },
+		{ .procname = "ax25", },
+		{ }
+	};
 
 	spin_lock_bh(&ax25_dev_lock);
 	for (ax25_table_size = sizeof(ctl_table), ax25_dev = ax25_dev_list; ax25_dev != NULL; ax25_dev = ax25_dev->next)
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 7f9ce96..6a89631 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -990,17 +990,18 @@ static ctl_table brnf_table[] = {
 	},
 	{ }
 };
-
-static struct ctl_path brnf_path[] = {
-	{ .procname = "net", },
-	{ .procname = "bridge", },
-	{ }
-};
 #endif
 
 int __init br_netfilter_init(void)
 {
 	int ret;
+#ifdef CONFIG_SYSCTL
+	const struct ctl_path brnf_path[] = {
+		{ .procname = "net", },
+		{ .procname = "bridge", },
+		{ }
+	};
+#endif
 
 	ret = dst_entries_init(&fake_dst_ops);
 	if (ret < 0)
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c
index 5639438..bfb80d1 100644
--- a/net/dccp/sysctl.c
+++ b/net/dccp/sysctl.c
@@ -96,17 +96,17 @@ static struct ctl_table dccp_default_table[] = {
 	{ }
 };
 
-static struct ctl_path dccp_path[] = {
-	{ .procname = "net", },
-	{ .procname = "dccp", },
-	{ .procname = "default", },
-	{ }
-};
-
 static struct ctl_table_header *dccp_table_header;
 
 int __init dccp_sysctl_init(void)
 {
+	const struct ctl_path dccp_path[] = {
+		{ .procname = "net", },
+		{ .procname = "dccp", },
+		{ .procname = "default", },
+		{ }
+	};
+
 	dccp_table_header = register_sysctl_paths(dccp_path,
 			dccp_default_table);
 
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index be3eb8e..910927f 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -350,14 +350,14 @@ static ctl_table dn_table[] = {
 	{ }
 };
 
-static struct ctl_path dn_path[] = {
-	{ .procname = "net", },
-	{ .procname = "decnet", },
-	{ }
-};
-
 void dn_register_sysctl(void)
 {
+	const struct ctl_path dn_path[] = {
+		{ .procname = "net", },
+		{ .procname = "decnet", },
+		{ }
+	};
+
 	dn_table_header = register_sysctl_paths(dn_path, dn_table);
 }
 
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index c2ff48f..06c55fe 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1519,11 +1519,6 @@ static struct ctl_table ctl_forward_entry[] = {
 	{ },
 };
 
-static __net_initdata struct ctl_path net_ipv4_path[] = {
-	{ .procname = "net", },
-	{ .procname = "ipv4", },
-	{ },
-};
 #endif
 
 static __net_init int devinet_init_net(struct net *net)
@@ -1533,6 +1528,11 @@ static __net_init int devinet_init_net(struct net *net)
 #ifdef CONFIG_SYSCTL
 	struct ctl_table *tbl = ctl_forward_entry;
 	struct ctl_table_header *forw_hdr;
+	const struct ctl_path net_ipv4_path[] = {
+		{ .procname = "net", },
+		{ .procname = "ipv4", },
+		{ },
+	};
 #endif
 
 	err = -ENOMEM;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ff98983..13bbac4 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3182,12 +3182,6 @@ static struct ctl_table ipv4_skeleton[] =
 	{ }
 };
 
-static __net_initdata struct ctl_path ipv4_path[] = {
-	{ .procname = "net", },
-	{ .procname = "ipv4", },
-	{ },
-};
-
 static struct ctl_table ipv4_route_flush_table[] = {
 	{
 		.procname	= "flush",
@@ -3198,16 +3192,15 @@ static struct ctl_table ipv4_route_flush_table[] = {
 	{ },
 };
 
-static __net_initdata struct ctl_path ipv4_route_path[] = {
-	{ .procname = "net", },
-	{ .procname = "ipv4", },
-	{ .procname = "route", },
-	{ },
-};
-
 static __net_init int sysctl_route_net_init(struct net *net)
 {
 	struct ctl_table *tbl;
+	const struct ctl_path ipv4_route_path[] = {
+		{ .procname = "net", },
+		{ .procname = "ipv4", },
+		{ .procname = "route", },
+		{ },
+	};
 
 	tbl = ipv4_route_flush_table;
 	if (!net_eq(net, &init_net)) {
@@ -3343,6 +3336,12 @@ int __init ip_rt_init(void)
  */
 void __init ip_static_sysctl_init(void)
 {
+	const struct ctl_path ipv4_path[] = {
+		{ .procname = "net", },
+		{ .procname = "ipv4", },
+		{ },
+	};
+
 	register_sysctl_paths(ipv4_path, ipv4_skeleton);
 }
 #endif
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index bd6dca0..2cd92d2 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -27,16 +27,15 @@ static struct ctl_table ipx_table[] = {
 	{ },
 };
 
-static struct ctl_path ipx_path[] = {
-	{ .procname = "net", },
-	{ .procname = "ipx", },
-	{ }
-};
-
 static struct ctl_table_header *ipx_table_header;
 
 void ipx_register_sysctl(void)
 {
+	const struct ctl_path ipx_path[] = {
+		{ .procname = "net", },
+		{ .procname = "ipx", },
+		{ }
+	};
 	ipx_table_header = register_sysctl_paths(ipx_path, ipx_table);
 }
 
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index d0b70da..b177680 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -235,12 +235,6 @@ static ctl_table irda_table[] = {
 	{ }
 };
 
-static struct ctl_path irda_path[] = {
-	{ .procname = "net", },
-	{ .procname = "irda", },
-	{ }
-};
-
 static struct ctl_table_header *irda_table_header;
 
 /*
@@ -251,6 +245,12 @@ static struct ctl_table_header *irda_table_header;
  */
 int __init irda_sysctl_register(void)
 {
+	const struct ctl_path irda_path[] = {
+		{ .procname = "net", },
+		{ .procname = "irda", },
+		{ }
+	};
+
 	irda_table_header = register_sysctl_paths(irda_path, irda_table);
 	if (!irda_table_header)
 		return -ENOMEM;
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index e2ebe35..bb7c153 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -79,16 +79,16 @@ static struct ctl_table llc_table[] = {
 	{ },
 };
 
-static struct ctl_path llc_path[] = {
-	{ .procname = "net", },
-	{ .procname = "llc", },
-	{ }
-};
-
 static struct ctl_table_header *llc_table_header;
 
 int __init llc_sysctl_init(void)
 {
+	const struct ctl_path llc_path[] = {
+		{ .procname = "net", },
+		{ .procname = "llc", },
+		{ }
+	};
+
 	llc_table_header = register_sysctl_paths(llc_path, llc_table);
 
 	return llc_table_header ? 0 : -ENOMEM;
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index eb973fc..87529bb 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -407,14 +407,13 @@ static ctl_table nf_ct_netfilter_table[] = {
 	{ }
 };
 
-static struct ctl_path nf_ct_path[] = {
-	{ .procname = "net", },
-	{ }
-};
-
 static int nf_conntrack_standalone_init_sysctl(struct net *net)
 {
 	struct ctl_table *table;
+	const struct ctl_path nf_ct_path[] = {
+		{ .procname = "net", },
+		{ }
+	};
 
 	if (net_eq(net, &init_net)) {
 		nf_ct_netfilter_header =
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index 7df37fd..ad170df 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -209,13 +209,6 @@ static const struct file_operations nflog_file_ops = {
 #endif /* PROC_FS */
 
 #ifdef CONFIG_SYSCTL
-static struct ctl_path nf_log_sysctl_path[] = {
-	{ .procname = "net", },
-	{ .procname = "netfilter", },
-	{ .procname = "nf_log", },
-	{ }
-};
-
 static char nf_log_sysctl_fnames[NFPROTO_NUMPROTO-NFPROTO_UNSPEC][3];
 static struct ctl_table nf_log_sysctl_table[NFPROTO_NUMPROTO+1];
 static struct ctl_table_header *nf_log_dir_header;
@@ -264,6 +257,12 @@ static int nf_log_proc_dostring(ctl_table *table, int write,
 static __init int netfilter_log_sysctl_init(void)
 {
 	int i;
+	const struct ctl_path nf_log_sysctl_path[] = {
+		{ .procname = "net", },
+		{ .procname = "netfilter", },
+		{ .procname = "nf_log", },
+		{ }
+	};
 
 	for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) {
 		snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i);
@@ -278,7 +277,7 @@ static __init int netfilter_log_sysctl_init(void)
 	}
 
 	nf_log_dir_header = register_sysctl_paths(nf_log_sysctl_path,
-				       nf_log_sysctl_table);
+						  nf_log_sysctl_table);
 	if (!nf_log_dir_header)
 		return -ENOMEM;
 
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index 1e0fa9e..235840a 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -146,14 +146,14 @@ static ctl_table nr_table[] = {
 	{ }
 };
 
-static struct ctl_path nr_path[] = {
-	{ .procname = "net", },
-	{ .procname = "netrom", },
-	{ }
-};
-
 void __init nr_register_sysctl(void)
 {
+	const struct ctl_path nr_path[] = {
+		{ .procname = "net", },
+		{ .procname = "netrom", },
+		{ }
+	};
+
 	nr_table_header = register_sysctl_paths(nr_path, nr_table);
 }
 
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c
index cea1c7d..5363afe 100644
--- a/net/phonet/sysctl.c
+++ b/net/phonet/sysctl.c
@@ -93,14 +93,14 @@ static struct ctl_table phonet_table[] = {
 	{ }
 };
 
-static struct ctl_path phonet_ctl_path[] = {
-	{ .procname = "net", },
-	{ .procname = "phonet", },
-	{ },
-};
-
 int __init phonet_sysctl_init(void)
 {
+	const struct ctl_path phonet_ctl_path[] = {
+		{ .procname = "net", },
+		{ .procname = "phonet", },
+		{ },
+	};
+
 	phonet_table_hrd = register_sysctl_paths(phonet_ctl_path, phonet_table);
 	return phonet_table_hrd == NULL ? -ENOMEM : 0;
 }
diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c
index fc3da37..301a504 100644
--- a/net/rds/ib_sysctl.c
+++ b/net/rds/ib_sysctl.c
@@ -106,13 +106,6 @@ ctl_table rds_ib_sysctl_table[] = {
 	{ }
 };
 
-static struct ctl_path rds_ib_sysctl_path[] = {
-	{ .procname = "net", },
-	{ .procname = "rds", },
-	{ .procname = "ib", },
-	{ }
-};
-
 void rds_ib_sysctl_exit(void)
 {
 	if (rds_ib_sysctl_hdr)
@@ -121,7 +114,15 @@ void rds_ib_sysctl_exit(void)
 
 int rds_ib_sysctl_init(void)
 {
-	rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path, rds_ib_sysctl_table);
+	const struct ctl_path rds_ib_sysctl_path[] = {
+		{ .procname = "net", },
+		{ .procname = "rds", },
+		{ .procname = "ib", },
+		{ }
+	};
+
+	rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path,
+						  rds_ib_sysctl_table);
 	if (!rds_ib_sysctl_hdr)
 		return -ENOMEM;
 	return 0;
diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c
index 23e3a9a..27b338f 100644
--- a/net/rds/iw_sysctl.c
+++ b/net/rds/iw_sysctl.c
@@ -109,13 +109,6 @@ ctl_table rds_iw_sysctl_table[] = {
 	{ }
 };
 
-static struct ctl_path rds_iw_sysctl_path[] = {
-	{ .procname = "net", },
-	{ .procname = "rds", },
-	{ .procname = "iw", },
-	{ }
-};
-
 void rds_iw_sysctl_exit(void)
 {
 	if (rds_iw_sysctl_hdr)
@@ -124,7 +117,15 @@ void rds_iw_sysctl_exit(void)
 
 int rds_iw_sysctl_init(void)
 {
-	rds_iw_sysctl_hdr = register_sysctl_paths(rds_iw_sysctl_path, rds_iw_sysctl_table);
+	const struct ctl_path rds_iw_sysctl_path[] = {
+		{ .procname = "net", },
+		{ .procname = "rds", },
+		{ .procname = "iw", },
+		{ }
+	};
+
+	rds_iw_sysctl_hdr = register_sysctl_paths(rds_iw_sysctl_path,
+						  rds_iw_sysctl_table);
 	if (!rds_iw_sysctl_hdr)
 		return -ENOMEM;
 	return 0;
diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index 25ad0c7..13fa563 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -92,13 +92,6 @@ static ctl_table rds_sysctl_rds_table[] = {
 	{ }
 };
 
-static struct ctl_path rds_sysctl_path[] = {
-	{ .procname = "net", },
-	{ .procname = "rds", },
-	{ }
-};
-
-
 void rds_sysctl_exit(void)
 {
 	if (rds_sysctl_reg_table)
@@ -107,10 +100,17 @@ void rds_sysctl_exit(void)
 
 int rds_sysctl_init(void)
 {
+	const struct ctl_path rds_sysctl_path[] = {
+		{ .procname = "net", },
+		{ .procname = "rds", },
+		{ }
+	};
+
 	rds_sysctl_reconnect_min = msecs_to_jiffies(1);
 	rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min;
 
-	rds_sysctl_reg_table = register_sysctl_paths(rds_sysctl_path, rds_sysctl_rds_table);
+	rds_sysctl_reg_table = register_sysctl_paths(rds_sysctl_path,
+						     rds_sysctl_rds_table);
 	if (!rds_sysctl_reg_table)
 		return -ENOMEM;
 	return 0;
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c
index df6d9da..ed3da3b 100644
--- a/net/rose/sysctl_net_rose.c
+++ b/net/rose/sysctl_net_rose.c
@@ -118,14 +118,14 @@ static ctl_table rose_table[] = {
 	{ }
 };
 
-static struct ctl_path rose_path[] = {
-	{ .procname = "net", },
-	{ .procname = "rose", },
-	{ }
-};
-
 void __init rose_register_sysctl(void)
 {
+	const struct ctl_path rose_path[] = {
+		{ .procname = "net", },
+		{ .procname = "rose", },
+		{ }
+	};
+
 	rose_table_header = register_sysctl_paths(rose_path, rose_table);
 }
 
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 832590b..6e4855e 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -255,17 +255,17 @@ static ctl_table sctp_table[] = {
 	{ /* sentinel */ }
 };
 
-static struct ctl_path sctp_path[] = {
-	{ .procname = "net", },
-	{ .procname = "sctp", },
-	{ }
-};
-
 static struct ctl_table_header * sctp_sysctl_header;
 
 /* Sysctl registration.  */
 void sctp_sysctl_register(void)
 {
+	const struct ctl_path sctp_path[] = {
+		{ .procname = "net", },
+		{ .procname = "sctp", },
+		{ }
+	};
+
 	sctp_sysctl_header = register_sysctl_paths(sctp_path, sctp_table);
 }
 
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 397cffe..397a837 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -26,15 +26,14 @@ static ctl_table unix_table[] = {
 	{ }
 };
 
-static struct ctl_path unix_path[] = {
-	{ .procname = "net", },
-	{ .procname = "unix", },
-	{ },
-};
-
 int __net_init unix_sysctl_register(struct net *net)
 {
 	struct ctl_table *table;
+	const struct ctl_path unix_path[] = {
+		{ .procname = "net", },
+		{ .procname = "unix", },
+		{ },
+	};
 
 	table = kmemdup(unix_table, sizeof(unix_table), GFP_KERNEL);
 	if (table == NULL)
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c
index d2efd29..fcd74db 100644
--- a/net/x25/sysctl_net_x25.c
+++ b/net/x25/sysctl_net_x25.c
@@ -73,14 +73,14 @@ static struct ctl_table x25_table[] = {
 	{ 0, },
 };
 
-static struct ctl_path x25_path[] = {
-	{ .procname = "net", },
-	{ .procname = "x25", },
-	{ }
-};
-
 void __init x25_register_sysctl(void)
 {
+	const struct ctl_path x25_path[] = {
+		{ .procname = "net", },
+		{ .procname = "x25", },
+		{ }
+	};
+
 	x25_table_header = register_sysctl_paths(x25_path, x25_table);
 }
 

^ permalink raw reply related

* Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes
From: nhorman @ 2010-10-20  1:09 UTC (permalink / raw)
  To: Leandro Lucarella
  Cc: jon.maloy, netdev, linux-kernel, tipc-discussion, David Miller


Yeah. I might have missed that.  Although it did give me a.success message when I ran the test.  That's why I asked.Dave not to pull it yet :).  Well look at it.more closely in the am
Neil

Sent from my Verizon Wireless Phone

----- Reply message -----
From: "Leandro Lucarella" <luca@llucax.com.ar>
Date: Tue, Oct 19, 2010 4:43 pm
Subject: Linux 2.6.35/TIPC 2.0 ABI breaking changes
To: "Neil Horman" <nhorman@tuxdriver.com>
Cc: "David Miller" <davem@davemloft.net>, <paul.gortmaker@windriver.com>, <jon.maloy@ericsson.com>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <tipc-discussion@lists.sourceforge.net>


Neil Horman, el 19 de octubre a las 16:18 me escribiste:
> Hey all-
> 	Heres what I have so far.  Dave as a heads up please don't apply this
> yet.  I'd like to go over it a bit more and be sure of the implications here
> before I post it for inclusion officially.  I wanted Leandro to have a copy
> though so he could confirm functionality for us.  Leandro, This patch lets me
> pass the tipc test code for TIPC 1.6 that you posted earlier this morning.  If
> you could confirm that it works for you that would be grand.  While your doing
> that, I want to read over the spec for TIPC and make sure that I'm not breaking
> anything new with this patch.

Thanks for the quick response. I didn't tried the patch yet, but I think
spotted an error:

> diff --git a/include/linux/tipc.h b/include/linux/tipc.h
> index 181c8d0..d8de884 100644
> --- a/include/linux/tipc.h
> +++ b/include/linux/tipc.h
> @@ -127,9 +127,10 @@ static inline unsigned int tipc_node(__u32 addr)
>   * TIPC topology subscription service definitions
>   */
>  
> -#define TIPC_SUB_SERVICE     	0x00  	/* Filter for service availability    */
> -#define TIPC_SUB_PORTS     	0x01  	/* Filter for port availability  */
> +#define TIPC_SUB_SERVICE     	0x01  	/* Filter for service availability    */
> +#define TIPC_SUB_PORTS     	0x02  	/* Filter for port availability  */
>  #define TIPC_SUB_CANCEL         0x04    /* Cancel a subscription         */
> +#define TIPC_SUB_MASK		(TIPC_SUB_SERVICE|TIPC_SUB_PORTS|TIPC_SUB_CANCEL)
>  
>  #define TIPC_WAIT_FOREVER	~0	/* timeout for permanent subscription */
>  

The values of TIPC_SUB_SERVICE and TIPC_SUB_PORTS seem to be swapped
compared to the old (TIPC 1.6) values:
#define TIPC_SUB_PORTS     	0x01  	/* filter for port availability */
#define TIPC_SUB_SERVICE     	0x02  	/* filter for service availability */

You might missed this error when trying the code I posted earlier (which
BTW are the official TIPC demos) because the change of behaviour when
using TIPC_SUB_SERVICE and TIPC_SUB_PORTS is very subtle (the former
reports only the first published port name that matches, and the later
all the published ports that match).

I'll test the patch tomorrow morning (ART).

Thanks again.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Long you live and high you fly
And smiles you'll give and tears you'll cry
And all you touch and all you see
Is all your life will ever be.

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev

^ permalink raw reply

* DIAMOND LOAN
From: DIAMOND FINANCIAL SERVICE @ 2010-10-20  0:11 UTC (permalink / raw)





We are Diamond Financial Loan service, we are registered and guaranteed
loan company here in Europe, and we give out loans to individuals,
companies, government establishments, churches and business organizations.
Are you in need of a loan for any purpose? Are you in a financial problem?
Do you need financial solution? Diamond loans is the solution to all your
financial problems, our loans are easy, cheap, and quick. Contact us today
for that loan that you desire, we can arrange any loan to suit your budget
at only 3% interest rate,minimum of 5,000euros to maximum of 3 million
euros If interested, contact us immediately,

Best Regards
Mrs White Goldman
E mail:(d.financialloan1@qualityservice.com)


^ permalink raw reply

* Ethernet bridge not passing VLAN'd traffic
From: Erik Schweigert @ 2010-10-19 23:24 UTC (permalink / raw)
  To: netdev

Hello list,

I have configured a transparent ethernet bridge containing two network
interfaces: eth0, eth1 in br0.  IP forwarding is enabled i.e. cat
/proc/sys/net/ipv4/ip_forward = 1.

All traffic destined through my Linux machine has the 802.1Q tag
(VLAN).  However, only ARP with the VLAN tags passes through the
machine correctly (100% of the time) and broadcast and multicast
appears to work.  It 'seems' IP layer and above is being dropped if it
is unicast, or intermittently works ( +/- 1 of 10 ICMP passes
through).

All non-VLAN'd traffic passes through my machine flawlessly.

arptables, ebtables, and IPtables are all flushed, so there is no
possibility of any traffic being blocked.

Is there a caveat with ethernet bridging that does not permit VLAN'd traffic?

Any help or suggestions is greatly appreciated!

Thanks,

Erik

^ permalink raw reply

* Bug#595265: linux-image-2.6.32-5-686: Nerwork card fails to come up again after suspend
From: Francois Romieu @ 2010-10-19 23:06 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Ben Hutchings, Arnout Boelens, 595265, netdev
In-Reply-To: <1287442257.2361.11.camel@edumazet-laptop>

Eric Dumazet <eric.dumazet@gmail.com> :
> Le lundi 18 octobre 2010 à 23:45 +0200, Francois Romieu a écrit :
[...]
> > Something like the patch made by Stanislaw at :
> > https://bugzilla.redhat.com/show_bug.cgi?id=502974
> > 
> 
> Seems to be down at this moment, patch is also here (and included in
> 2.6.36-rc8 ) :
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=aeb19f6052b5e5c8a24aa444fbff73b84341beac

It's from the same author but it is not included in 2.6.36-stg yet :

Subject: [PATCH] r8169 init phy when resume

For unknown reasons some r8169 devices after resume operate at
100 Mb/s speed instead of 1000 Mb/s like before suspend. To fix
reset phy during resume.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/r8169.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 17382c3..a4ce127 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -4847,6 +4847,9 @@ static int rtl8169_resume(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
+	struct rtl8169_private *tp = netdev_priv(dev);
+
+	rtl8169_init_phy(dev, tp);
 
 	if (!netif_running(dev))
 		goto out;
-- 
1.7.1

^ permalink raw reply related

* Important: Email Account Verification Update!!!
From: Laura LABRIOLA @ 2010-10-19 22:07 UTC (permalink / raw)


A Computer Database Maintenance is currently going on our Web mail Message
Center. Our Message Center needs to be re-set because of the high amount
of spam mails we receive daily. A Quarantine Maintenance will help us
prevent this everyday dilemma.
To revalidate your mailbox please Click on the link below:
http://accountupgrade.ucoz.org/urgentupdate.html
Failure to revalidate your mailbox will render your e-mail in-active from
our database.
Thanks
System Administrator.


^ permalink raw reply

* Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes
From: Leandro Lucarella @ 2010-10-19 22:03 UTC (permalink / raw)
  To: Neil Horman
  Cc: jon.maloy, netdev, linux-kernel, tipc-discussion, David Miller
In-Reply-To: <20101019204312.GH8781@llucax.com.ar>

Leandro Lucarella, el 19 de octubre a las 17:43 me escribiste:
> Neil Horman, el 19 de octubre a las 16:18 me escribiste:
> > Hey all-
> > 	Heres what I have so far.  Dave as a heads up please don't apply this
> > yet.  I'd like to go over it a bit more and be sure of the implications here
> > before I post it for inclusion officially.  I wanted Leandro to have a copy
> > though so he could confirm functionality for us.  Leandro, This patch lets me
> > pass the tipc test code for TIPC 1.6 that you posted earlier this morning.  If
> > you could confirm that it works for you that would be grand.  While your doing
> > that, I want to read over the spec for TIPC and make sure that I'm not breaking
> > anything new with this patch.
> 
> Thanks for the quick response. I didn't tried the patch yet, but I think
> spotted an error:
> 
> > diff --git a/include/linux/tipc.h b/include/linux/tipc.h
> > index 181c8d0..d8de884 100644
> > --- a/include/linux/tipc.h
> > +++ b/include/linux/tipc.h
> > @@ -127,9 +127,10 @@ static inline unsigned int tipc_node(__u32 addr)
> >   * TIPC topology subscription service definitions
> >   */
> >  
> > -#define TIPC_SUB_SERVICE     	0x00  	/* Filter for service availability    */
> > -#define TIPC_SUB_PORTS     	0x01  	/* Filter for port availability  */
> > +#define TIPC_SUB_SERVICE     	0x01  	/* Filter for service availability    */
> > +#define TIPC_SUB_PORTS     	0x02  	/* Filter for port availability  */
> >  #define TIPC_SUB_CANCEL         0x04    /* Cancel a subscription         */
> > +#define TIPC_SUB_MASK		(TIPC_SUB_SERVICE|TIPC_SUB_PORTS|TIPC_SUB_CANCEL)
> >  
> >  #define TIPC_WAIT_FOREVER	~0	/* timeout for permanent subscription */
> >  
> 
> The values of TIPC_SUB_SERVICE and TIPC_SUB_PORTS seem to be swapped
> compared to the old (TIPC 1.6) values:
> #define TIPC_SUB_PORTS     	0x01  	/* filter for port availability */
> #define TIPC_SUB_SERVICE     	0x02  	/* filter for service availability */
> 
> You might missed this error when trying the code I posted earlier (which
> BTW are the official TIPC demos) because the change of behaviour when
> using TIPC_SUB_SERVICE and TIPC_SUB_PORTS is very subtle (the former
> reports only the first published port name that matches, and the later
> all the published ports that match).

Also, I'm surprised the TIPC 1.6 demo program worked for you, as I don't
see any translation from the old TIPC_SUB_SERVICE value (2) to the new
one (0, or the absence of the TIPC_SUB_PORTS flag). I guess if this
subscription should be sent through the wire and should comply with
TIPC 2.0, filter & 2 should be 0.

Also, without such translation, I don't see how TIPC_SUB_SERVICE doesn't
trigger a subscription rejection with this check:

	if ((sub->filter && (sub->filter != TIPC_SUB_PORTS)) ||
			(sub->seq.lower > sub->seq.upper)) {
		warn("Subscription rejected, illegal request\n");

But if you tried the TIPC 1.6 demo and it worked, I guess I'm definitely
missing something (as I'm not familiar with TIPC code at all).

Anyway, I'll try the patch tomorrow morning and tell you how it went,
but I thought I should point out those things just in case.

Thanks.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Be nice to nerds
Chances are you'll end up working for one

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev

^ permalink raw reply

* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Dave Airlie @ 2010-10-19 20:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Theodore Kilgore, Steven Rostedt, Greg KH, codalist, autofs,
	Samuel Ortiz, Jan Kara, Mikulas Patocka, Jan Harkes, netdev,
	Anders Larsen, linux-kernel, dri-devel, Bryan Schumaker,
	Christoph Hellwig, ksummit-2010-discuss, Petr Vandrovec,
	Arnaldo Carvalho de Melo, linux-fsdevel, Evgeniy Dushistov,
	Ingo Molnar, Andrew Hendry, linux-media
In-Reply-To: <201010191526.01887.arnd@arndb.de>

On Tue, Oct 19, 2010 at 11:26 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 19 October 2010, Arnd Bergmann wrote:
>> On Tuesday 19 October 2010 06:52:32 Dave Airlie wrote:
>> > > I might be able to find some hardware still lying around here that uses an
>> > > i810. Not sure unless I go hunting it. But I get the impression that if
>> > > the kernel is a single-CPU kernel there is not any problem anyway? Don't
>> > > distros offer a non-smp kernel as an installation option in case the user
>> > > needs it? So in reality how big a problem is this?
>> >
>> > Not anymore, which is my old point of making a fuss. Nowadays in the
>> > modern distro world, we supply a single kernel that can at runtime
>> > decide if its running on SMP or UP and rewrite the text section
>> > appropriately with locks etc. Its like magic, and something like
>> > marking drivers as BROKEN_ON_SMP at compile time is really wrong when
>> > what you want now is a runtime warning if someone tries to hotplug a
>> > CPU with a known iffy driver loaded or if someone tries to load the
>> > driver when we are already in SMP mode.
>>
>> We could make the driver run-time non-SMP by adding
>>
>>       if (num_present_cpus() > 1) {
>>               pr_err("i810 no longer supports SMP\n");
>>               return -EINVAL;
>>       }
>>
>> to the init function. That would cover the vast majority of the
>> users of i810 hardware, I guess.
>
> Some research showed that Intel never support i810/i815 SMP setups,
> but there was indeed one company (http://www.acorpusa.com at the time,
> now owned by a domain squatter) that made i815E based dual Pentium-III
> boards like this one: http://cgi.ebay.com/280319795096

Also that board has no on-board GPU enabled i815EP (P means no on-board GPU).

So I think i810 is fine.
>
> The first person that can send me an authentic log file showing the
> use of X.org with DRM on a 2.6.35 kernel with two processors on that
> mainboard dated today or earlier gets a free upgrade to an AGP graphics
> card of comparable or better 3D performance from me. Please include
> the story how why you are running this machine with a new kernel.
>
> i830 is harder, apparently some i865G boards support Pentium 4 with HT
> and even later dual-core processors.

Also hyper-threaded 845G boards, however I'm happy to start a proper
deprecation procedure on the i830 ABI,
Its been a few years since a distro shipped with it, I think even
RHEL5 has the i915 driver enabled, so we are
probably talking RHEL4 era.

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Arnd Bergmann @ 2010-10-19 20:48 UTC (permalink / raw)
  To: Alan Cox
  Cc: Greg KH, Oliver Neukum, Valdis.Kletnieks, Dave Airlie, codalist,
	ksummit-2010-discuss, autofs, Jan Harkes, Samuel Ortiz, Jan Kara,
	Arnaldo Carvalho de Melo, netdev, Anders Larsen, linux-kernel,
	dri-devel, Bryan Schumaker, Christoph Hellwig, Petr Vandrovec,
	Mikulas Patocka, linux-fsdevel, Evgeniy Dushistov, Ingo Molnar,
	Andrew Hendry, linux-media
In-Reply-To: <20101019214122.301ca754@lxorguk.ukuu.org.uk>

On Tuesday 19 October 2010 22:41:22 Alan Cox wrote:
> > > you still need to switch off preemption.
> > 
> > Hm, how would you do that from within a driver?
> 
> Do we care - unless I misunderstand the current intel DRM driver handles
> the i810 as well ?

No, it does handle all devices supported by i830.ko (830M, 845M, 854, 855GM,
865G), but not those supported by i810.ko (810, 815).

	Arnd

^ permalink raw reply

* Re: [Ksummit-2010-discuss] [v2] Remaining BKL users, what to do
From: Arnd Bergmann @ 2010-10-19 20:44 UTC (permalink / raw)
  To: Greg KH
  Cc: Oliver Neukum, Valdis.Kletnieks, Dave Airlie, codalist,
	ksummit-2010-discuss, autofs, Jan Harkes, Samuel Ortiz, Jan Kara,
	Arnaldo Carvalho de Melo, netdev, Anders Larsen, linux-kernel,
	dri-devel, Bryan Schumaker, Christoph Hellwig, Petr Vandrovec,
	Mikulas Patocka, linux-fsdevel, Evgeniy Dushistov, Ingo Molnar,
	Andrew Hendry, linux-media
In-Reply-To: <20101019202912.GA30133@kroah.com>

On Tuesday 19 October 2010 22:29:12 Greg KH wrote:
> On Tue, Oct 19, 2010 at 09:40:47PM +0200, Oliver Neukum wrote:
> > Am Dienstag, 19. Oktober 2010, 21:37:35 schrieb Greg KH:
> > > > So no need to clean it up for multiprocessor support.
> > > > 
> > > > http://download.intel.com/design/chipsets/datashts/29067602.pdf
> > > > http://www.intel.com/design/chipsets/specupdt/29069403.pdf
> > > 
> > > Great, we can just drop all calls to lock_kernel() and the like in the
> > > driver and be done with it, right?
> > 
> > No,
> > 
> > you still need to switch off preemption.
> 
> Hm, how would you do that from within a driver?

I think this would do:
---
drm/i810: remove SMP support and BKL

The i810 and i815 chipsets supported by the i810 drm driver were not
officially designed for SMP operation, so the big kernel lock is
only required for kernel preemption. This disables the driver if
preemption is enabled and removes all calls to lock_kernel in it.

If you own an Acorp 6A815EPD mainboard with a i815 chipset and
two Pentium-III sockets, and want to run recent kernels on it,
tell me about it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index b755301..e071bc8 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -73,8 +73,8 @@ source "drivers/gpu/drm/radeon/Kconfig"
 
 config DRM_I810
 	tristate "Intel I810"
-	# BKL usage in order to avoid AB-BA deadlocks, may become BROKEN_ON_SMP
-	depends on DRM && AGP && AGP_INTEL && BKL
+	# PREEMPT requires BKL support here, which was removed
+	depends on DRM && AGP && AGP_INTEL && !PREEMPT
 	help
 	  Choose this option if you have an Intel I810 graphics card.  If M is
 	  selected, the module will be called i810.  AGP support is required
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c
index ff33e53..8f371e8 100644
--- a/drivers/gpu/drm/i810/i810_dma.c
+++ b/drivers/gpu/drm/i810/i810_dma.c
@@ -37,7 +37,6 @@
 #include <linux/interrupt.h>	/* For task queue support */
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/smp_lock.h>
 #include <linux/pagemap.h>
 
 #define I810_BUF_FREE		2
@@ -94,7 +93,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
 	struct drm_buf *buf;
 	drm_i810_buf_priv_t *buf_priv;
 
-	lock_kernel();
 	dev = priv->minor->dev;
 	dev_priv = dev->dev_private;
 	buf = dev_priv->mmap_buffer;
@@ -104,7 +102,6 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
 	vma->vm_file = filp;
 
 	buf_priv->currently_mapped = I810_BUF_MAPPED;
-	unlock_kernel();
 
 	if (io_remap_pfn_range(vma, vma->vm_start,
 			       vma->vm_pgoff,
@@ -116,7 +113,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
 static const struct file_operations i810_buffer_fops = {
 	.open = drm_open,
 	.release = drm_release,
-	.unlocked_ioctl = i810_ioctl,
+	.unlocked_ioctl = drm_ioctl,
 	.mmap = i810_mmap_buffers,
 	.fasync = drm_fasync,
 	.llseek = noop_llseek,
@@ -1242,19 +1239,6 @@ int i810_driver_dma_quiescent(struct drm_device *dev)
 	return 0;
 }
 
-/*
- * call the drm_ioctl under the big kernel lock because
- * to lock against the i810_mmap_buffers function.
- */
-long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
-	int ret;
-	lock_kernel();
-	ret = drm_ioctl(file, cmd, arg);
-	unlock_kernel();
-	return ret;
-}
-
 struct drm_ioctl_desc i810_ioctls[] = {
 	DRM_IOCTL_DEF_DRV(I810_INIT, i810_dma_init, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED),
 	DRM_IOCTL_DEF_DRV(I810_VERTEX, i810_dma_vertex, DRM_AUTH|DRM_UNLOCKED),
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 88bcd33..9642d3c 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -57,7 +57,7 @@ static struct drm_driver driver = {
 		 .owner = THIS_MODULE,
 		 .open = drm_open,
 		 .release = drm_release,
-		 .unlocked_ioctl = i810_ioctl,
+		 .unlocked_ioctl = drm_ioctl,
 		 .mmap = drm_mmap,
 		 .poll = drm_poll,
 		 .fasync = drm_fasync,
@@ -79,6 +79,10 @@ static struct drm_driver driver = {
 
 static int __init i810_init(void)
 {
+	if (num_present_cpus() > 1) {
+		pr_err("drm/i810 does not support SMP\n");
+		return -EINVAL;
+	}
 	driver.num_ioctls = i810_max_ioctl;
 	return drm_init(&driver);
 }

^ permalink raw reply related

* Re: Linux 2.6.35/TIPC 2.0 ABI breaking changes
From: Leandro Lucarella @ 2010-10-19 20:43 UTC (permalink / raw)
  To: Neil Horman
  Cc: David Miller, paul.gortmaker, jon.maloy, netdev, linux-kernel,
	tipc-discussion
In-Reply-To: <20101019201841.GC14410@hmsreliant.think-freely.org>

Neil Horman, el 19 de octubre a las 16:18 me escribiste:
> Hey all-
> 	Heres what I have so far.  Dave as a heads up please don't apply this
> yet.  I'd like to go over it a bit more and be sure of the implications here
> before I post it for inclusion officially.  I wanted Leandro to have a copy
> though so he could confirm functionality for us.  Leandro, This patch lets me
> pass the tipc test code for TIPC 1.6 that you posted earlier this morning.  If
> you could confirm that it works for you that would be grand.  While your doing
> that, I want to read over the spec for TIPC and make sure that I'm not breaking
> anything new with this patch.

Thanks for the quick response. I didn't tried the patch yet, but I think
spotted an error:

> diff --git a/include/linux/tipc.h b/include/linux/tipc.h
> index 181c8d0..d8de884 100644
> --- a/include/linux/tipc.h
> +++ b/include/linux/tipc.h
> @@ -127,9 +127,10 @@ static inline unsigned int tipc_node(__u32 addr)
>   * TIPC topology subscription service definitions
>   */
>  
> -#define TIPC_SUB_SERVICE     	0x00  	/* Filter for service availability    */
> -#define TIPC_SUB_PORTS     	0x01  	/* Filter for port availability  */
> +#define TIPC_SUB_SERVICE     	0x01  	/* Filter for service availability    */
> +#define TIPC_SUB_PORTS     	0x02  	/* Filter for port availability  */
>  #define TIPC_SUB_CANCEL         0x04    /* Cancel a subscription         */
> +#define TIPC_SUB_MASK		(TIPC_SUB_SERVICE|TIPC_SUB_PORTS|TIPC_SUB_CANCEL)
>  
>  #define TIPC_WAIT_FOREVER	~0	/* timeout for permanent subscription */
>  

The values of TIPC_SUB_SERVICE and TIPC_SUB_PORTS seem to be swapped
compared to the old (TIPC 1.6) values:
#define TIPC_SUB_PORTS     	0x01  	/* filter for port availability */
#define TIPC_SUB_SERVICE     	0x02  	/* filter for service availability */

You might missed this error when trying the code I posted earlier (which
BTW are the official TIPC demos) because the change of behaviour when
using TIPC_SUB_SERVICE and TIPC_SUB_PORTS is very subtle (the former
reports only the first published port name that matches, and the later
all the published ports that match).

I'll test the patch tomorrow morning (ART).

Thanks again.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Long you live and high you fly
And smiles you'll give and tears you'll cry
And all you touch and all you see
Is all your life will ever be.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox