Re: 2.6.20-rc4-mm1: PCI=n: drivers/net/3c59x.c compile error

2007-03-09 Thread Tejun Heo
Hello, Randy Dunlap wrote: Erm, before I do that, could somebody explain what #define HAVE_PCI_REQ_REGIONS 2 accompanying their declaration is for? I have't found any references to it in the source. Should I duplicate it for CONFIG_PCI=n case (I guess not)? I wouldn't since it's

Re: 2.6.21-rc3-git4 ata1.00: qc timeout (cmd 0xef) (crashdump kernel)

2007-03-12 Thread Tejun Heo
Michal Piotrowski wrote: Calling initcall 0xc19154d8: piix_ide_init+0x0/0xbb() Calling initcall 0xc19155b6: generic_ide_init+0x0/0x16() Calling initcall 0xc191572e: ide_init+0x0/0x81() Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes;

Re: 2.6.21-rc3-git4 ata1.00: qc timeout (cmd 0xef) (crashdump kernel)

2007-03-12 Thread Tejun Heo
Thomas Gleixner wrote: On Tue, 2007-03-13 at 01:37 +0900, Tejun Heo wrote: Michal Piotrowski wrote: Calling initcall 0xc19154d8: piix_ide_init+0x0/0xbb() Calling initcall 0xc19155b6: generic_ide_init+0x0/0x16() Calling initcall 0xc191572e: ide_init+0x0/0x81() Uniform Multi-Platform E-IDE

Re: 2.6.21-rc3-git4 ata1.00: qc timeout (cmd 0xef) (crashdump kernel)

2007-03-12 Thread Tejun Heo
Thomas Gleixner wrote: On Mon, 2007-03-12 at 17:31 +0100, Michal Piotrowski wrote: Calling initcall 0xc19154d8: piix_ide_init+0x0/0xbb() Calling initcall 0xc19155b6: generic_ide_init+0x0/0x16() Calling initcall 0xc191572e: ide_init+0x0/0x81() Uniform Multi-Platform E-IDE driver Revision:

Re: 2.6.21-rc3-git4 ata1.00: qc timeout (cmd 0xef) (crashdump kernel)

2007-03-12 Thread Tejun Heo
Stephen Hemminger wrote: 1. the controller has IRQ stuck high (infrequent but possible) 2. the IRQ is already requested by another device 3. the IRQ gets disabled due to screaming interrupts at the moment ata_piix does pci_enable_device(). I think we can be much more resilient to screaming

Re: 2.6.21-rc3-git4 ata1.00: qc timeout (cmd 0xef) (crashdump kernel)

2007-03-12 Thread Tejun Heo
Stephen Hemminger wrote: On Tue, 13 Mar 2007 04:03:00 +0900 Tejun Heo [EMAIL PROTECTED] wrote: Stephen Hemminger wrote: 1. the controller has IRQ stuck high (infrequent but possible) 2. the IRQ is already requested by another device 3. the IRQ gets disabled due to screaming interrupts

Re: [patch 0/5][RFC] Update network drivers to use devres

2007-08-03 Thread Tejun Heo
On Fri, Aug 03, 2007 at 09:58:57AM +0100, Stephen Hemminger wrote: On Thu, 2 Aug 2007 15:42:06 -0700 Brandon Philips [EMAIL PROTECTED] wrote: This patch set adds support for devres in the net core and converts the e100 and e1000 drivers to devres. Devres is a simple resource manager for

Re: [patch 0/5][RFC] Update network drivers to use devres

2007-08-03 Thread Tejun Heo
Hello, Stephen Hemminger wrote: Skimming through drivers... via-rhine doesn't disable PCI device on init failure path but does so on removal. sky2 doesn't free consistent memory if sky2_init() fails. acenic calls iounmap() with NULL parameter which I'm not sure whether it's safe or not.

Re: [patch 2/5][RFC] Update net core to use devres.

2007-08-03 Thread Tejun Heo
+static inline void * register_netdev_devres(struct device *gendev, + struct net_device *dev) +{ + struct net_device **p; + + /* 0 size because we don't need it. The net_device is already alloc'd + * in alloc_netdev_mq. We can't use

Re: [patch 3/5][RFC] Update e100 driver to use devres.

2007-08-03 Thread Tejun Heo
registers, aborting.\n); err = -ENOMEM; - goto err_out_free_res; + return err; Calls to pci_request_regions() and pcim_iomap() can be merged into pcim_iomap_regions(). Other than that, Acked-by: Tejun Heo [EMAIL PROTECTED] -- tejun - To unsubscribe from

Re: [patch 1/5][RFC] NET: Change pci_enable_device to pci_reenable_device to keep device enable balance

2007-08-03 Thread Tejun Heo
Brandon Philips wrote: On a slot_reset event pci_disable_device() is never called so calling pci_enable_device() will unbalance the enable count. Signed-off-by: Brandon Philips [EMAIL PROTECTED] Acked-by: Tejun Heo [EMAIL PROTECTED] -- tejun - To unsubscribe from this list: send the line

Re: [patch 4/5][RFC] Implement devm_kcalloc

2007-08-03 Thread Tejun Heo
that, Acked-by: Tejun Heo [EMAIL PROTECTED] -- tejun - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [patch 5/5][RFC] Update e1000 driver to use devres.

2007-08-03 Thread Tejun Heo
On Thu, Aug 02, 2007 at 03:45:52PM -0700, Brandon Philips wrote: if ((err = pci_request_regions(pdev, e1000_driver_name))) - goto err_pci_reg; + goto err_dma; Why not just return? Ditto for all goto err_dma's. err = -EIO; - adapter-hw.hw_addr =

Re: [patch 2/4] Update e100 driver to use devres.

2007-08-16 Thread Tejun Heo
Brandon Philips wrote: @@ -2554,8 +2547,10 @@ static int __devinit e100_probe(struct p struct net_device *netdev; struct nic *nic; int err; + void __iomem **iomap; + int bar; - if(!(netdev = alloc_etherdev(sizeof(struct nic { + if (!(netdev =

Re: [patch 4/4] Update e1000 driver to use devres.

2007-08-16 Thread Tejun Heo
Brandon Philips wrote: - mmio_start = pci_resource_start(pdev, BAR_0); mmio_len = pci_resource_len(pdev, BAR_0); You don't need mmio_len either. - err = -EIO; - adapter-hw.hw_addr = ioremap(mmio_start, mmio_len); + adapter-hw.hw_addr = pcim_iomap(pdev, BAR_0,

Re: [PATCH] e1000e: Update e1000e driver to use devres

2007-08-17 Thread Tejun Heo
Brandon Philips wrote: Conversion of e1000e probe() and remove() to devres. Depends on [patch 1/4] Update net core to use devres. Signed-off-by: Brandon Philips [EMAIL PROTECTED] Acked-by: Tejun Heo [EMAIL PROTECTED] -- tejun - To unsubscribe from this list: send the line unsubscribe

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-20 Thread Tejun Heo
Hello, Rob. On Sun, Apr 19, 2015 at 02:25:09AM -0500, Rob Landley wrote: If you have two machines plugged into a hub, and that's _all_ that's plugged in, packets should never get dropped. This was the original use case of netconsole was that the sender and the receiver were plugged into the

Re: [PATCH 04/16] printk: implement support for extended console drivers

2015-04-28 Thread Tejun Heo
Hello, Petr. On Tue, Apr 28, 2015 at 11:42:44AM +0200, Petr Mladek wrote: Note that cont buffer is only a memory optimization. You could put every text snippet into the ring buffer and console immediately. You need to set LOG_CONT instead of LOG_NEWLINE flag. This is already used when the

Re: [PATCH 04/16] printk: implement support for extended console drivers

2015-04-27 Thread Tejun Heo
Hello, Petr. Sorry about the delay. On Mon, Apr 20, 2015 at 05:43:07PM +0200, Petr Mladek wrote: ... * Extended message formatting for console drivers is enabled iff there s/iff/if/ if and only if I was afraid that there might be a potential buffer overflow because the user-provided

[PATCH 2/3] netconsole: make all dynamic netconsoles share a mutex

2015-05-01 Thread Tejun Heo
and this'd allow adding operations which should be synchronized across all dynamic netconsoles. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net

Re: [PATCHSET] netconsole: implement extended console support

2015-05-07 Thread Tejun Heo
Ping? Thanks. -- tejun -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 4/4] netconsole: implement extended console support

2015-05-11 Thread Tejun Heo
Hello, On Mon, May 11, 2015 at 01:23:39PM -0400, David Miller wrote: From: Tejun Heo t...@kernel.org Date: Mon, 11 May 2015 12:41:34 -0400 + /* need to insert extra header fields, detect header and body */ + header = msg; + body = memchr(msg, ';', msg_len); + if (WARN_ON_ONCE

[PATCH 2/4] netconsole: make netconsole_target-enabled a bool

2015-05-11 Thread Tejun Heo
netconsole uses both bool and int for boolean values. Let's convert nt-enabled to bool for consistency. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 06/16] netconsole: make netconsole_target-enabled a bool

2015-04-16 Thread Tejun Heo
We'll add more bool's to netconsole_target. Let's convert -enabled to bool first so that things stay consistent. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions

[PATCH 11/16] netconsole: consolidate enable/disable and create/destroy paths

2015-04-16 Thread Tejun Heo
(). free_param_target() is no longer used and removed. While the conversions aren't one-to-one equivalent, this patch shouldn't cause any visible behavior differences and makes extension of the enable/disable logic a lot easier. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net

[PATCH 13/16] netconsole: implement retransmission support for extended consoles

2015-04-16 Thread Tejun Heo
-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 238 +++ 1 file changed, 238 insertions(+) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 626d9f0..b2763e0 100644 --- a/drivers/net

[PATCH 12/16] netconsole: implement extended console support

2015-04-16 Thread Tejun Heo
printk to format extended messages, extended netconsole is registered with printk iff it's actually used. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 159 ++- 1 file changed, 158 insertions

[PATCH 10/16] netconsole: introduce netconsole_mutex

2015-04-16 Thread Tejun Heo
consoles. The above mentioned race is removed by this change. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 48 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/net

[PATCH 07/16] netconsole: factor out alloc_netconsole_target()

2015-04-16 Thread Tejun Heo
alloc_param_target() and make_netconsole_target() were duplicating the same allocation and init logic. Factor it out to alloc_netconsole_target(). This is pure reorganization. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 40

[PATCH 04/16] printk: implement support for extended console drivers

2015-04-16 Thread Tejun Heo
there are registered extended consoles. * Comment describing extended message formats updated to help distinguishing variable with verbatim terms. Signed-off-by: Tejun Heo t...@kernel.org Cc: Kay Sievers k...@vrfy.org Cc: Petr Mladek pmla...@suse.cz --- include/linux/console.h | 1 + kernel

[PATCH 15/16] netconsole: implement netconsole receiver library

2015-04-16 Thread Tejun Heo
. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- tools/Makefile| 16 +- tools/lib/netconsole/Makefile | 36 ++ tools/lib/netconsole/ncrx.c | 906 ++ tools/lib/netconsole/ncrx.h | 204 ++ tools/ncrx

[PATCH 16/16] netconsole: update documentation for extended netconsole

2015-04-16 Thread Tejun Heo
Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- Documentation/networking/netconsole.txt | 95 - 1 file changed, 94 insertions(+), 1 deletion(-) diff --git a/Documentation/networking/netconsole.txt b/Documentation/networking

[PATCH 14/16] netconsole: implement ack handling and emergency transmission

2015-04-16 Thread Tejun Heo
interfere with the normal transmission path. Even if something goes wrong with timer, the normal transmission path should keep working. Emergency transmissions are marked with emg=1 header. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c

[PATCH 08/16] netconsole: punt disabling to workqueue from netdevice_notifier

2015-04-16 Thread Tejun Heo
it by introducing a mutex to protect overall enable / disable operations; unfortunately, the locking update couldn't be ordered before this change due to the locking order with rtnl_lock. Signed-off-by: Tejun Heo t...@kernel.org Cc: David Miller da...@davemloft.net --- drivers/net/netconsole.c | 58

[PATCH 05/16] printk: implement log_seq_range() and ext_log_from_seq()

2015-04-16 Thread Tejun Heo
reliable netconsole. Signed-off-by: Tejun Heo t...@kernel.org Cc: Kay Sievers k...@vrfy.org Cc: Petr Mladek pmla...@suse.cz --- include/linux/printk.h | 14 kernel/printk/printk.c | 96 ++ 2 files changed, 110 insertions(+) diff --git a/include

[PATCH 01/16] printk: guard the amount written per line by devkmsg_read()

2015-04-16 Thread Tejun Heo
that complicated. This patch defines CONSOLE_EXT_LOG_MAX as 8192 and updates devkmsg_read() so that it limits output accordingly. Signed-off-by: Tejun Heo t...@kernel.org Cc: Kay Sievers k...@vrfy.org Cc: Petr Mladek pmla...@suse.cz --- include/linux/printk.h | 2 ++ kernel/printk/printk.c | 35

[PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-16 Thread Tejun Heo
In a lot of configurations, netconsole is a useful way to collect system logs; however, all netconsole does is simply emitting UDP packets for the raw messages and there's no way for the receiver to find out whether the packets were lost and/or reordered in flight. printk already keeps log

[PATCH 02/16] printk: factor out message formatting from devkmsg_read()

2015-04-16 Thread Tejun Heo
The extended message formatting used for /dev/kmsg will be used implement extended consoles. Factor out msg_print_ext_header() and msg_print_ext_body() from devkmsg_read(). This is pure restructuring. Signed-off-by: Tejun Heo t...@kernel.org Cc: Kay Sievers k...@vrfy.org Cc: Petr Mladek pmla

[PATCH 03/16] printk: move LOG_NOCONS skipping into call_console_drivers()

2015-04-16 Thread Tejun Heo
messages themselves. While this makes call_console_drivers() iterate over LOG_NOCONS messages, this is extremely unlikely to matter especially given that continuation lines aren't that common and also simplifies console_unlock() a bit. Signed-off-by: Tejun Heo t...@kernel.org Cc: Kay Sievers k

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
Hello, On Sat, Apr 18, 2015 at 03:20:41AM +0900, Tetsuo Handa wrote: I didn't mean to introduce netconsole's own version of metadata. I meant we don't need to implement in-kernel retry logic. Hmmm? I'm not really following where this discussion is headed. No, we don't have to put it in the

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
Just a bit of addition. On Fri, Apr 17, 2015 at 01:37:54PM -0400, Tejun Heo wrote: Upto patch 12, it's just the same mechanism transferring extended messages. It doesn't add any smartness to netconsole per-se except that it can now emit messages with metadata headers. What do you think

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
Hello, David. On Fri, Apr 17, 2015 at 01:17:12PM -0400, David Miller wrote: If userland cannot run properly, it is almost certain that neither will your complex reliability layer logic. * The bulk of patches are to pipe extended log messages to console drivers and let netconsole relay them

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
On Sat, Apr 18, 2015 at 03:03:46AM +0900, Tetsuo Handa wrote: If you tolerate loss of kernel messages, adding sequence number to each UDP Well, there's a difference between accepting loss when log buffer overflows and when any packets get lost. packet will be sufficient for finding out whether

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
On Sat, Apr 18, 2015 at 02:43:30AM +0900, Tetsuo Handa wrote: Upto patch 12, it's just the same mechanism transferring extended messages. It doesn't add any smartness to netconsole per-se except that it can now emit messages with metadata headers. What do you think about them? So,

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
Hello, On Sat, Apr 18, 2015 at 12:35:06AM +0900, Tetsuo Handa wrote: If the sender side can wait for retransmission, why can't we use userspace programs (e.g. rsyslogd)? Because the system may be oopsing, ooming or threshing excessively rendering the userland inoperable and that's exactly when

Re: [PATCHSET] printk, netconsole: implement reliable netconsole

2015-04-17 Thread Tejun Heo
Hello, On Fri, Apr 17, 2015 at 02:55:37PM -0400, David Miller wrote: * The bulk of patches are to pipe extended log messages to console drivers and let netconsole relay them to the receiver (and quite a bit of refactoring in the process), which, regardless of the reliability logic,

Re: [PATCH v2 v4.2-rc1] printk: make extended printk support conditional on netconsole

2015-07-03 Thread Tejun Heo
On Fri, Jul 03, 2015 at 04:07:34PM +0200, Petr Mladek wrote: @@ -2561,9 +2591,11 @@ void register_console(struct console *newcon) console_drivers-next = newcon; } - if (newcon-flags CON_EXTENDED) - if (!nr_ext_console_drivers++) + if (newcon-flags

[PATCH v3 v4.2-rc1] printk: make extended printk support conditional on netconsole

2015-07-03 Thread Tejun Heo
is requested while CONFIG_PRINTK_CON_EXTENDED is disabled as suggested by Petr. v3: Moved ext console enable info messages into the inc function. Signed-off-by: Tejun Heo t...@kernel.org Reported-and-suggested-by: Geert Uytterhoeven ge...@linux-m68k.org Reviewed-by: Petr Mladek pmla...@suse.com

Re: [PATCH 3/3] printk: implement support for extended console drivers

2015-06-29 Thread Tejun Heo
On Mon, Jun 29, 2015 at 05:47:49PM +0200, Geert Uytterhoeven wrote: netconsole itself is optional modular. I'm not sure making further splits is called for, especially given the use cases. It could be a hidden option, selected by its users (e.g. netconsole). Hmmm... what do you mean?

Re: [PATCH 3/3] printk: implement support for extended console drivers

2015-06-29 Thread Tejun Heo
Hello, On Mon, Jun 29, 2015 at 11:20:41AM +0200, Geert Uytterhoeven wrote: On Wed, Apr 29, 2015 at 4:45 PM, Tejun Heo t...@kernel.org wrote: --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2196,6 +2227,7 @@ out: */ void console_unlock(void) { + static char

Re: [PATCH 3/3] printk: implement support for extended console drivers

2015-06-29 Thread Tejun Heo
On Mon, Jun 29, 2015 at 06:11:40PM +0200, Geert Uytterhoeven wrote: On Mon, Jun 29, 2015 at 5:49 PM, Tejun Heo t...@kernel.org wrote: On Mon, Jun 29, 2015 at 05:47:49PM +0200, Geert Uytterhoeven wrote: netconsole itself is optional modular. I'm not sure making further splits is called

[PATCH v2 v4.2-rc1] printk: make extended printk support conditional on netconsole

2015-07-02 Thread Tejun Heo
is requested while CONFIG_PRINTK_CON_EXTENDED is disabled as suggested by Petr. Cc: Petr Mladek pmla...@suse.com Signed-off-by: Tejun Heo t...@kernel.org Reported-and-suggested-by: Geert Uytterhoeven ge...@linux-m68k.org --- drivers/net/Kconfig|1 + init/Kconfig |3

[PATCH v4.2-rc1] printk: make extended printk support conditional on netconsole

2015-06-29 Thread Tejun Heo
. This patch introduces CONFIG_PRINTK_CON_EXTENDED which is selected by CONFIG_NETCONSOLE. If the config option is not set, extended printk support is compiled out along with the static buffer. Verified 8k reduction in vmlinux bss when !CONFIG_NETCONSOLE. Signed-off-by: Tejun Heo t...@kernel.org Reported

Re: [PATCH] printk: Warn about dropped messages also on extended consoles

2015-07-30 Thread Tejun Heo
, dropped_count); + if (nr_ext_console_drivers) + ext_len = sprintf(ext_text, dropped_msg, + dropped_count); And you can't shove random message in front of the header. Nacked-by: Tejun Heo t...@kernel.org Thanks

Re: [PATCH 1/5] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it

2015-11-17 Thread Tejun Heo
On Tue, Nov 17, 2015 at 11:54:54PM +0100, Jan Engelhardt wrote: > > On Tuesday 2015-11-17 20:40, Tejun Heo wrote: > >+static inline bool cgroup_is_descendant(struct cgroup *cgrp, > >+struct cgroup *ancestor) > > (const struct group *

Re: [PATCH iptables] libxt_cgroup2: add support for cgroup2 path matching

2015-11-17 Thread Tejun Heo
Hello, On Wed, Nov 18, 2015 at 12:02:01AM +0100, Jan Engelhardt wrote: > On Tuesday 2015-11-17 20:42, Tejun Heo wrote: > >+static void cgroup2_save(const void *ip, const struct xt_entry_match *match) > >+{ > >+const struct xt_cgroup2_info *info = (void *)match->data;

[PATCH 1/5] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it

2015-11-17 Thread Tejun Heo
paring the recorded ancestor_id at the matching level. cgroup_is_descendant() is accordingly reimplmented and made inline. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup-defs.h | 14 ++ include/linux/cgroup.h | 18 +- kernel/cgroup.c

[PATCH 2/5] kernfs: implement kernfs_walk_and_get()

2015-11-17 Thread Tejun Heo
Implement kernfs_walk_and_get() which is similar to kernfs_find_and_get() but can walk a path instead of just a name. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> --- fs/kernfs/dir.c

[PATCHSET] netfilter, cgroup: implement xt_cgroup2 match

2015-11-17 Thread Tejun Heo
Hello, In cgroup v1, dealing with cgroup membership was difficult because the number of membership associations was unbound. As a result, cgroup v1 grew several controllers whose primary purpose is either tagging membership or pull in configuration knobs from other subsystems so that cgroup

[PATCH 4/5] sock, cgroup: add sock->sk_cgroup

2015-11-17 Thread Tejun Heo
up with a reasonable one. For the longer term, the fields can be rearranged so that disabling prio and cls controllers reduce the size of the struct. This patch doesn't make use of the added field yet. The following patch will implement netfilter match for cgroup2 membership. Signed-off-by: Tejun Heo

[PATCH iptables] libxt_cgroup2: add support for cgroup2 path matching

2015-11-17 Thread Tejun Heo
This patch adds the extension for the xt_cgroup2 which matches packets based on the v2 cgroup path of the associated socket. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Daniel Borkmann <dbork...@redhat.com> --- extensions/libxt_cgroup2.c

[PATCH 3/5] cgroup: implement cgroup_get_from_path() and expose cgroup_put()

2015-11-17 Thread Tejun Heo
Implement cgroup_get_path() using kernfs_walk_and_get() which obtains a default hierarchy cgroup from its path. This will be used to allow cgroup path based matching from outside cgroup proper - e.g. networking and perf. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup.

[PATCH 5/5] netfilter: implement xt_cgroup2 match

2015-11-17 Thread Tejun Heo
This patch implements xt_cgroup2 which matches cgroup2 membership of the associated socket. The match is recursive and invertible. For rationales on introducing another cgroup based match, please refer to a preceding commit "sock, cgroup: add sock->sk_cgroup". Signed-off-by:

Possible netlink autobind regression

2015-09-16 Thread Tejun Heo
Hello, We're seeing processes piling up on audit_cmd_mutex and after some digging it turns out sometimes audit_receive() ends up recursing into itself causing an A-A deadlock on audit_cmd_mutex. Here's the backtrace. PID: 1939995 TASK: 88085bdde360 CPU: 27 COMMAND: "crond" #0

Re: Possible netlink autobind regression

2015-09-17 Thread Tejun Heo
. > > Fixes: c0bb07df7d98 ("netlink: Reset portid after netlink_insert failure") > Reported-by: Tejun Heo <t...@kernel.org> > Reported-by: Linus Torvalds <torva...@linux-foundation.org> > Signed-off-by: Herbert Xu <herb...@gondor.apana.org.au> > Reviewed-

Re: netlink: Add netlink_bound helper and use it in netlink_getname

2015-09-26 Thread Tejun Heo
Hello, Herbert. On Sun, Sep 27, 2015 at 03:41:10AM +0800, Herbert Xu wrote: > Thread 1 Thread 2 > sendmsg getsockname > netlink_autobindnetlink_getname > > Thread 2 should not have to do anything special to guarantee that >

Re: netlink: Add netlink_bound helper and use it in netlink_getname

2015-09-26 Thread Tejun Heo
Hello, On Sun, Sep 27, 2015 at 03:49:16AM +0800, Herbert Xu wrote: > If the autobind is not complete then netlink_getname must return > zero rather than some garbage portid that belongs to somebody > else's socket. That's what we did before any of this lockless > code was introduced. > > If you

Re: netlink: Add netlink_bound helper and use it in netlink_getname

2015-09-26 Thread Tejun Heo
Hello, On Sun, Sep 27, 2015 at 04:10:41AM +0800, Herbert Xu wrote: > Well guess what the bug that you have discovered supposedly due to > a missing barrier in netlink_connect has nothing to do with the > barrier. Instead it is caused by a logical error elsewhere that > would have gone unnoticed

Re: netlink: Add netlink_bound helper and use it in netlink_getname

2015-09-26 Thread Tejun Heo
Hello, Herbert. On Sat, Sep 26, 2015 at 09:16:21PM +0800, Herbert Xu wrote: > You misunderstood what I wrote. I was not basing this on whether > user-space transitions contained a barrier, but on the fact that > the next syscall must recheck nlk->bound before using nlk->portid. But that isn't

Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-30 Thread Tejun Heo
On Wed, Sep 30, 2015 at 11:32:19AM -0500, Felipe Balbi wrote: > On Wed, Sep 30, 2015 at 12:20:46PM -0400, Tejun Heo wrote: > > On Wed, Sep 30, 2015 at 11:19:25AM -0500, Felipe Balbi wrote: > > > On Mon, Sep 28, 2015 at 03:35:14PM +0200, Christoph Hellwig wrote: > > > &

Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-30 Thread Tejun Heo
On Wed, Sep 30, 2015 at 11:19:25AM -0500, Felipe Balbi wrote: > On Mon, Sep 28, 2015 at 03:35:14PM +0200, Christoph Hellwig wrote: > > On Sun, Sep 27, 2015 at 10:50:53AM -0500, Felipe Balbi wrote: > > > this (and the other helper below) could be macros just fine. > > > > They could, but they

Re: [PATCH 02/23] usb-gadget: use per-attribute show and store methods

2015-09-30 Thread Tejun Heo
On Wed, Sep 30, 2015 at 11:43:01AM -0500, Felipe Balbi wrote: > Seems like there are *ton* of uses of container_of() wrapped within a simple > macro. What convention are you talking about, again ? The convention of using inline functions over macros when possible. We don't do that all the time

Re: netlink: Add netlink_bound helper and use it in netlink_getname

2015-09-26 Thread Tejun Heo
Hello, On Sun, Sep 27, 2015 at 03:55:48AM +0800, Herbert Xu wrote: > Well I disagree. When I say that it returns to user-space I really > mean that the next time we use portid via the same call path that > triggered the connect we must be checking nlk->bound anyway. > > Good luck finding more

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
Hello, Herbert. On Wed, Sep 23, 2015 at 02:13:42PM +0800, Herbert Xu wrote: > It doesn't matter on x86 but the semantics of smp_load_acquire > and smp_store_release explicitly includes a full barrier which > is something that we don't need. Yeah, I was confused there. I was thinking smp_rmb()

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-22 Thread Tejun Heo
Hello, On Tue, Sep 22, 2015 at 12:28:45PM -0700, Linus Torvalds wrote: > Both acquire and smp_rmb() are equally free on x86. Was this always like this? Ah, okay, from 2007. Was thinking it's still doing an actual rmb. Talk about being confused. > It appears that we don't do the

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-22 Thread Tejun Heo
Hello, Linus. On Tue, Sep 22, 2015 at 11:42:33AM -0700, Linus Torvalds wrote: ... > smp_rmb() should generally be about the same cost as an acquire. It > can go either way. > > So *if* the algorithm is amenable to smp_wmb()/smp_rmb() kind of > barriers, that's actually quite possibly better than

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-24 Thread Tejun Heo
Hello, David. On Thu, Sep 24, 2015 at 12:11:42PM -0700, David Miller wrote: > From: Herbert Xu > Date: Tue, 22 Sep 2015 11:38:56 +0800 > > > The commit 1f770c0a09da855a2b51af6d19de97fb955eca85 ("netlink: > > Fix autobind race condition that leads to zero port ID")

Re: netlink: Add barrier to netlink_connect for theoretical case

2015-09-25 Thread Tejun Heo
Hello, Herbert. On Fri, Sep 25, 2015 at 09:43:27AM +0800, Herbert Xu wrote: > Well had you said this in the first place I would've fixed it a > long time ago. There aren't any in-kernel users right now and > even if there were they'd have to do a connect/bind/sendmsg on > the same socket in two

Re: netlink: Add barrier to netlink_connect for theoretical case

2015-09-25 Thread Tejun Heo
Hello, Herbert. On Fri, Sep 25, 2015 at 11:39:57AM +0800, Herbert Xu wrote: > +static inline bool netlink_bound(struct netlink_sock *nlk) > +{ > + bool bound = READ_ONCE(nlk->bound); > + > + /* Ensure nlk is hashed and visible. */ > + if (bound) > + smp_rmb(); > + > +

Re: [PATCH v3] netlink: Fix autobind race condition that leads to zero port ID

2015-09-18 Thread Tejun Heo
Hello, Herbert. On Fri, Sep 18, 2015 at 02:36:10PM +0800, Herbert Xu wrote: > On Thu, Sep 17, 2015 at 07:30:34AM -0400, Tejun Heo wrote: > > > > Maybe add that this led to a deadlock and add a Link tag to this > > thread? > > I'll add a note about the deadlock

[PATCH] netlink: Replace rhash_portid with load_acquire protected boolean

2015-09-21 Thread Tejun Heo
atch and updated so that all readers test via a helper which does load_acquire. Fixes: 1f770c0a09da ("netlink: Fix autobind race condition that leads to zero port ID") Reported-by: Tejun Heo <t...@kernel.org> Reported-by: Linus Torvalds <torva...@linux-foundation.or

Re: netlink: Replace rhash_portid with bound

2015-09-21 Thread Tejun Heo
Hello, Herbert. On Mon, Sep 21, 2015 at 09:34:16PM +0800, Herbert Xu wrote: > @@ -1119,7 +1120,11 @@ static int netlink_insert(struct sock *sk, u32 portid) > goto err; > } > > - nlk_sk(sk)->portid = portid; > + /* rhashtable_insert carries an implicit write memory

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
Hello, On Thu, Sep 24, 2015 at 11:21:00AM +0800, Herbert Xu wrote: > Well we'll have to agree to disagree on that one. I have seen too > many instances over the years where people post patches that use > primitives such as RCU and think that they must be safe because > it compiles with no

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
On Thu, Sep 24, 2015 at 11:31:17AM +0800, Herbert Xu wrote: > No this isn't what happened. My error was trying to see if there > is a way to do it without barriers. In the end there wasn't. This > has nothing to do with using primitives. Hmmm... yeah, you can say that, but it still was a

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
On Thu, Sep 24, 2015 at 11:42:14AM +0800, Herbert Xu wrote: > Well I disagree so let's leave it at that. Leaving things disagreed is fine but there's still a patch to commit here, so I get that you're still dead against just applying the pattern? -- tejun -- To unsubscribe from this list: send

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
Hello, Herbert. On Thu, Sep 24, 2015 at 10:30:11AM +0800, Herbert Xu wrote: > Well if someone provided helpers which > > 1) uses smp_wmb and smp_rmb instead of full barriers; This part is fine. > 2) provides raw variants for the cases that barriers aren't needed Hmm... It looks like I'm

Re: [PATCH v2] netlink: Replace rhash_portid with bound

2015-09-23 Thread Tejun Heo
Hello, On Thu, Sep 24, 2015 at 10:54:36AM +0800, Herbert Xu wrote: > What I am concerned about is the next guy who comes along and > does a rewrite like the one that introduced the netlink_bind > bug. That person needs to fully understand what each primitive > is protecting against. > > Using

Re: [PATCH 01/23] configfs: add show and store methods to struct configfs_attribute

2015-09-25 Thread Tejun Heo
Hello, Christoph. On Fri, Sep 25, 2015 at 06:49:38AM -0700, Christoph Hellwig wrote: > Add methods to struct configfs_attribute to directly show and store > attributes without adding boilerplate code to every user. In addition > to the methods this also adds 3 helper macros to define read/write,

[PATCH net-next] cgroup: fix sock_cgroup_data initialization on earlier compilers

2015-12-09 Thread Tejun Heo
: (near initialization for ‘skcd_buf.’) This is because .val belongs to the anonymous union nested inside the struct but the initializer is missing the nesting. Fix it by adding an extra pair of braces. Signed-off-by: Tejun Heo <t...@kernel.org> Reported-by: Alaa Hleihel <a...@dev.mella

[PATCH 8/8] netfilter: implement xt_cgroup cgroup2 path match

2015-12-07 Thread Tejun Heo
. v3: Folded into xt_cgroup as a new revision interface as suggested by Pablo. v2: Included linux/limits.h from xt_cgroup2.h for PATH_MAX. Added explicit alignment to the priv field. Both suggested by Jan. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Daniel Borkmann <dan...@iogearbox.

[PATCH 5/8] net: wrap sock->sk_cgrp_prioidx and ->sk_classid inside a struct

2015-12-07 Thread Tejun Heo
roup_data and can be moved to netprio_cgroup.h without causing include dependency loop. Moved. * The dummy version of sock_update_netprioidx() converted to a static inline function while at it. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgro

[PATCH 4/8] netprio_cgroup: limit the maximum css->id to USHRT_MAX

2015-12-07 Thread Tejun Heo
tually useable. This allows reducing sock->sk_cgrp_prioidx to u16 from u32. The freed up part will be used to overload the cgroup related fields. sock->sk_cgrp_prioidx's position is swapped with sk_mark so that the two cgroup related fields are adjacent. Signed-off-by: Tejun Heo <t...@ke

[PATCH 7/8] netfilter: prepare xt_cgroup for multi revisions

2015-12-07 Thread Tejun Heo
xt_cgroup will grow cgroup2 path based match. Postfix existing symbols with _v0 and prepare for multi revision registration. Signed-off-by: Tejun Heo <t...@kernel.org> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: Daniel Wagner <daniel.wag...@bmw-carit.de> CC: Neil Horman <

[PATCH 6/8] sock, cgroup: add sock->sk_cgroup

2015-12-07 Thread Tejun Heo
er yet. The following patch will implement netfilter match for cgroup2 membership. v2: Use sock_cgroup_data to avoid inflating struct sock w/ another cgroup specific field. v3: Add comments explaining why sock_data_prioidx() and sock_data_classid() use different fallback values. Signed-off-by:

[PATCH 2/8] kernfs: implement kernfs_walk_and_get()

2015-12-07 Thread Tejun Heo
Implement kernfs_walk_and_get() which is similar to kernfs_find_and_get() but can walk a path instead of just a name. v2: Use strlcpy() instead of strlen() + memcpy() as suggested by David. Signed-off-by: Tejun Heo <t...@kernel.org> Acked-by: Greg Kroah-Hartman <gre...@linuxfound

[PATCH 1/8] cgroup: record ancestor IDs and reimplement cgroup_is_descendant() using it

2015-12-07 Thread Tejun Heo
paring the recorded ancestor_id at the matching level. cgroup_is_descendant() is accordingly reimplmented and made inline. Signed-off-by: Tejun Heo <t...@kernel.org> --- include/linux/cgroup-defs.h | 14 ++ include/linux/cgroup.h | 18 +- kernel/cgroup.c

[PATCH net-next] net, cgroup: cgroup_sk_updat_lock was missing initializer

2015-12-14 Thread Tejun Heo
bd1060a1d671 ("sock, cgroup: add sock->sk_cgroup") added global spinlock cgroup_sk_update_lock but erroneously skipped initializer leading to uninitialized spinlock warning. Fix it by using DEFINE_SPINLOCK(). Signed-off-by: Tejun Heo <t...@kernel.org> Reported-by: Dexuan Cui &

Re: [RFC PATCH net-next] net: Add l3mdev cgroup

2016-01-04 Thread Tejun Heo
Hello, David. On Mon, Jan 04, 2016 at 11:53:55AM -0700, David Ahern wrote: > On 1/4/16 10:58 AM, Tejun Heo wrote: > >Please don't create any new controller whose sole purpose is > >identifying group membership. Please take a look at how libxt_cgroup > >handles identificati

Re: [RFC PATCH net-next] net: Add l3mdev cgroup

2016-01-04 Thread Tejun Heo
Hello, On Mon, Jan 04, 2016 at 12:59:15PM -0700, David Ahern wrote: > cgroups have very nice properties that I want to leverage such as > parent-child inheritance and easy tracking which subsystem instance a task > belongs. This provides a great kernel foundation for building easy to use >

Re: [RFC PATCH net-next] net: Add l3mdev cgroup

2016-01-04 Thread Tejun Heo
Hello, David. On Mon, Jan 04, 2016 at 12:17:08PM -0700, David Ahern wrote: > None of the existing subsystems are relevant for configuring an L3 > networking domain, and it does not make sense to tie net_cls and net_prio to > an L3 domain. I don't have an answer for that but cgroup isn't a place

  1   2   3   >