14 Oct, 2015

1 commit


26 Jun, 2015

4 commits

  • printk logbuf keeps various metadata and optional key=value dictionary for
    structured messages, both of which are stripped when messages are handed
    to regular console drivers.

    It can be useful to have this metadata and dictionary available to
    netconsole consumers. This obviously makes logging via netconsole more
    complete and the sequence number in particular is useful in environments
    where messages may be lost or reordered in transit - e.g. when netconsole
    is used to collect messages in a large cluster where packets may have to
    travel congested hops to reach the aggregator. The lost and reordered
    messages can easily be identified and handled accordingly using the
    sequence numbers.

    printk recently added extended console support which can be selected by
    setting CON_EXTENDED flag. From console driver side, not much changes.
    The only difference is that the text passed to the write callback is
    formatted the same way as /dev/kmsg.

    This patch implements extended console support for netconsole which can be
    enabled by either prepending "+" to a netconsole boot param entry or
    echoing 1 to "extended" file in configfs. When enabled, netconsole
    transmits extended log messages with headers identical to /dev/kmsg
    output.

    There's one complication due to message fragments. netconsole limits the
    maximum message size to 1k and messages longer than that are split into
    multiple fragments. As all extended console messages should carry
    matching headers and be uniquely identifiable, each extended message
    fragment carries full copy of the metadata and an extra header field to
    identify the specific fragment. The optional header is of the form
    "ncfrag=OFF/LEN" where OFF is the byte offset into the message body and
    LEN is the total length.

    To avoid unnecessarily making printk format extended messages, Extended
    netconsole is registered with printk when the first extended netconsole is
    configured.

    Signed-off-by: Tejun Heo
    Cc: David Miller
    Cc: Kay Sievers
    Cc: Petr Mladek
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Currently, each dynamic netconsole_target uses its own separate mutex to
    synchronize the configuration operations.

    This patch replaces the per-netconsole_target mutexes with a single
    mutex - dynamic_netconsole_mutex. The reduced granularity doesn't hurt
    anything, the code is minutely simpler and this'd allow adding
    operations which should be synchronized across all dynamic netconsoles.

    Signed-off-by: Tejun Heo
    Cc: David Miller
    Cc: Kay Sievers
    Cc: Petr Mladek
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    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
    Cc: David Miller
    Cc: Kay Sievers
    Cc: Petr Mladek
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • write_msg() grabs target_list_lock and walks target_list invoking
    netpool_send_udp() on each target. Curiously, it protects each iteration
    with netconsole_target_get/put() even though it never releases
    target_list_lock which protects all the members.

    While this doesn't harm anything, it doesn't serve any purpose either.
    The items on the list can't go away while target_list_lock is held.
    Remove the unnecessary get/put pair.

    Signed-off-by: Tejun Heo
    Cc: David Miller
    Cc: Kay Sievers
    Cc: Petr Mladek
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

04 Mar, 2015

1 commit


05 Nov, 2013

1 commit

  • Conflicts:
    drivers/net/ethernet/emulex/benet/be.h
    drivers/net/netconsole.c
    net/bridge/br_private.h

    Three mostly trivial conflicts.

    The net/bridge/br_private.h conflict was a function signature (argument
    addition) change overlapping with the extern removals from Joe Perches.

    In drivers/net/netconsole.c we had one change adjusting a printk message
    whilst another changed "printk(KERN_INFO" into "pr_info(".

    Lastly, the emulex change was a new inline function addition overlapping
    with Joe Perches's extern removals.

    Signed-off-by: David S. Miller

    David S. Miller
     

30 Oct, 2013

1 commit

  • Use a more current logging style.

    Convert printks to pr_.

    Consolidate multiple printks into a single printk to avoid
    any possible dmesg interleaving. Add a default "event" msg
    in case the listed types are ever expanded.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

26 Oct, 2013

2 commits

  • In every netconsole option that can be set through configfs there's a
    race when checking for nt->enabled since it can be modified at the same
    time. Probably the most damage can be done by store_enabled when racing
    with another instance of itself. Fix all the races with one stone by
    moving the mutex lock around the ->store call for all options.

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     
  • We need to disable the netconsole (enabled = 0) before setting nt->np.dev
    to NULL because otherwise we might still have users after the
    netpoll_cleanup() since nt->enabled is set afterwards and we can
    have a message which will result in a NULL pointer dereference.
    It is very easy to hit dereferences all over the netpoll_send_udp function
    by running the following two loops in parallel:
    while [ 1 ]; do echo 1 > enabled; echo 0 > enabled; done;
    while [ 1 ]; do echo 00:11:22:33:44:55 > remote_mac; done;
    (the second loop is to generate messages, it can be done by anything)

    We're safe to set nt->np.dev = NULL and nt->enabled = 0 with the spinlock
    since it's required in the write_msg() function.

    Signed-off-by: Nikolay Aleksandrov
    Reviewed-by: Veacelsav Falico
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

20 Sep, 2013

1 commit

  • This bug was introduced by commit
    7a163bfb7ce50895bbe67300ea610d31b9c09230 ("netconsole: avoid a crash with
    multiple sysfs writers"). In store_enabled() we have the following
    sequence: acquire nt->mutex then rtnl, but in the netconsole netdev
    notifier we have rtnl then nt->mutex effectively leading to a deadlock.
    The NULL pointer dereference that the above commit tries to fix is
    actually due to another bug in netpoll_cleanup(). This is fixed by dropping
    the mutex from the netdev notifier as it's already protected by rtnl.

    Signed-off-by: Nikolay Aleksandrov
    Signed-off-by: David S. Miller

    Nikolay Aleksandrov
     

04 Sep, 2013

1 commit

  • When my 'ifup eth' script was fired multiple times and ran concurrent on
    my laptop, for some obscure /etc scripting reason, it was revealed
    that the store_enabled() function in netconsole doesn't handle it nicely,
    as recorded by the Oops below (a syslog paste, but not mangled too much
    to prevent from discerning the traceback).

    On Linux 3.10.4, this patch seeks to remedy the problem, and it has been
    running stable on my laptop for a few days.

    [52608.609325] BUG: unable to handle kernel NULL pointer dereference at 00000000000003e0
    [52608.609331] IP: [] __netpoll_cleanup+0x27/0xe0
    [52608.609339] PGD 15e51a067 PUD 15433e067 PMD 0
    [52608.609343] Oops: 0000 [#1] SMP re firewire_ohci firewire_core crc_itu_t [last unloaded: kvm_intel]
    [52608.609347] Modules linked in: kvm_intel tun vfat fat ppdev parport_pc parport fuse ipt_MASQUERADE usb_storage nf_conntrack_netbios_ns nf_conn [..garbled..]
    [52608.609433] RAX: 0000000000000000 RBX: ffff880210bbcc68 RCX: 0000000000000000
    [52608.609435] RDX: 0000000000000000 RSI: ffff8801ba447da0 RDI: ffff880210bbcc68
    [52608.609437] RBP: ffff8801ba447e18 R08: 0000000000000000 R09: 0000000000000001
    [52608.609439] R10: 000000000000000a R11: f000000000000000 R12: ffff880210bbcc68
    [52608.609441] R13: ffff88020bc41000 R14: 0000000000000002 R15: 000000000000000200000000000
    [52608.609443] FS: 00007f38d7bff740(0000) GS:ffff88021dc40000(0000) knlGS:0000000000000000
    [52608.609446] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003300000000001427e0
    [52608.609448] CR2: 00000000000003e0 CR3: 0000000154103000 CR4: 00000000001427e0
    [52608.609450] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [52608.609452] netpoll: netconsole: local port 6665ess 10.0.0.27
    [52608.609454] netpoll: netconsole: local IPv4 address 10.0.0.27
    [52608.609456] netpoll: netconsole: interface 'em1'
    [52608.609457] netpoll: netconsole: remote port 514ress 10.0.0.15
    [52608.609459] netpoll: netconsole: remote IPv4 address 10.0.0.15:65:a8:9a:c7
    [52608.609461] netpoll: netconsole: remote ethernet address 1c:6f:65:a8:9a:c7
    [52608.609463] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [52608.609464] Stack:801ba447e08 ffff880210bbcc68 ffffffffffffffea ffff88020bc41000
    [52608.609466] ffff8801ba447e08 ffff880210bbcc68 ffffffffffffffea ffff88020bc41000
    [52608.609471] 0000000000000002 0000000000000002 ffff8801ba447e38 ffffffff81532af4
    [52608.609475] 0000000000000000 ffff880210bbcc00 ffff8801ba447e78 ffffffff81420e7c
    [52608.609479] Call Trace:
    [52608.609484] [] netpoll_cleanup+0x24/0x50
    [52608.609489] [] store_enabled+0x5c/0xe0
    [52608.609492] [] netconsole_target_attr_store+0x2e/0x40
    [52608.609498] [] configfs_write_file+0xd2/0x130
    [52608.609503] [] vfs_write+0xc5/0x1f0
    [52608.609506] [] SyS_write+0x52/0xa0/0x10
    [52608.609511] [] ? do_page_fault+0xe/0x10
    [52608.609516] [] system_call_fastpath+0x16/0x1b
    [52608.609517] Code: 1f 44 00 00 0f 1f 44 00 00 55 48 89 e5 48 83 ec 30 4c 89 65 e0 48 89 5d d8 49 89 fc 4c 89 6d e8 4c 89 75 f0 4c 89 7d f8 48 8 [..garbled..]
    [52608.609559] RIP [] __netpoll_cleanup+0x27/0xe0
    [52608.609563] RSP
    [52608.609564] CR2: 00000000000003e0
    [52608.609567] ---[ end trace d25ec343349b61d2 ]---

    Signed-off-by: Dan Aloni
    Signed-off-by: Neil Horman
    CC: David S. Miller
    Signed-off-by: David S. Miller

    Dan Aloni
     

10 Jul, 2013

1 commit

  • Pull networking updates from David Miller:
    "This is a re-do of the net-next pull request for the current merge
    window. The only difference from the one I made the other day is that
    this has Eliezer's interface renames and the timeout handling changes
    made based upon your feedback, as well as a few bug fixes that have
    trickeled in.

    Highlights:

    1) Low latency device polling, eliminating the cost of interrupt
    handling and context switches. Allows direct polling of a network
    device from socket operations, such as recvmsg() and poll().

    Currently ixgbe, mlx4, and bnx2x support this feature.

    Full high level description, performance numbers, and design in
    commit 0a4db187a999 ("Merge branch 'll_poll'")

    From Eliezer Tamir.

    2) With the routing cache removed, ip_check_mc_rcu() gets exercised
    more than ever before in the case where we have lots of multicast
    addresses. Use a hash table instead of a simple linked list, from
    Eric Dumazet.

    3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from
    Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski,
    Marek Puzyniak, Michal Kazior, and Sujith Manoharan.

    4) Support reporting the TUN device persist flag to userspace, from
    Pavel Emelyanov.

    5) Allow controlling network device VF link state using netlink, from
    Rony Efraim.

    6) Support GRE tunneling in openvswitch, from Pravin B Shelar.

    7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from
    Daniel Borkmann and Eric Dumazet.

    8) Allow controlling of TCP quickack behavior on a per-route basis,
    from Cong Wang.

    9) Several bug fixes and improvements to vxlan from Stephen
    Hemminger, Pravin B Shelar, and Mike Rapoport. In particular,
    support receiving on multiple UDP ports.

    10) Major cleanups, particular in the area of debugging and cookie
    lifetime handline, to the SCTP protocol code. From Daniel
    Borkmann.

    11) Allow packets to cross network namespaces when traversing tunnel
    devices. From Nicolas Dichtel.

    12) Allow monitoring netlink traffic via AF_PACKET sockets, in a
    manner akin to how we monitor real network traffic via ptype_all.
    From Daniel Borkmann.

    13) Several bug fixes and improvements for the new alx device driver,
    from Johannes Berg.

    14) Fix scalability issues in the netem packet scheduler's time queue,
    by using an rbtree. From Eric Dumazet.

    15) Several bug fixes in TCP loss recovery handling, from Yuchung
    Cheng.

    16) Add support for GSO segmentation of MPLS packets, from Simon
    Horman.

    17) Make network notifiers have a real data type for the opaque
    pointer that's passed into them. Use this to properly handle
    network device flag changes in arp_netdev_event(). From Jiri
    Pirko and Timo Teräs.

    18) Convert several drivers over to module_pci_driver(), from Peter
    Huewe.

    19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a
    O(1) calculation instead. From Eric Dumazet.

    20) Support setting of explicit tunnel peer addresses in ipv6, just
    like ipv4. From Nicolas Dichtel.

    21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet.

    22) Prevent a single high rate flow from overruning an individual cpu
    during RX packet processing via selective flow shedding. From
    Willem de Bruijn.

    23) Don't use spinlocks in TCP md5 signing fast paths, from Eric
    Dumazet.

    24) Don't just drop GSO packets which are above the TBF scheduler's
    burst limit, chop them up so they are in-bounds instead. Also
    from Eric Dumazet.

    25) VLAN offloads are missed when configured on top of a bridge, fix
    from Vlad Yasevich.

    26) Support IPV6 in ping sockets. From Lorenzo Colitti.

    27) Receive flow steering targets should be updated at poll() time
    too, from David Majnemer.

    28) Fix several corner case regressions in PMTU/redirect handling due
    to the routing cache removal, from Timo Teräs.

    29) We have to be mindful of ipv4 mapped ipv6 sockets in
    upd_v6_push_pending_frames(). From Hannes Frederic Sowa.

    30) Fix L2TP sequence number handling bugs, from James Chapman."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits)
    drivers/net: caif: fix wrong rtnl_is_locked() usage
    drivers/net: enic: release rtnl_lock on error-path
    vhost-net: fix use-after-free in vhost_net_flush
    net: mv643xx_eth: do not use port number as platform device id
    net: sctp: confirm route during forward progress
    virtio_net: fix race in RX VQ processing
    virtio: support unlocked queue poll
    net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit
    Documentation: Fix references to defunct linux-net@vger.kernel.org
    net/fs: change busy poll time accounting
    net: rename low latency sockets functions to busy poll
    bridge: fix some kernel warning in multicast timer
    sfc: Fix memory leak when discarding scattered packets
    sit: fix tunnel update via netlink
    dt:net:stmmac: Add dt specific phy reset callback support.
    dt:net:stmmac: Add support to dwmac version 3.610 and 3.710
    dt:net:stmmac: Allocate platform data only if its NULL.
    net:stmmac: fix memleak in the open method
    ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available
    net: ipv6: fix wrong ping_v6_sendmsg return value
    ...

    Linus Torvalds
     

06 Jun, 2013

1 commit

  • Since we have at least one user of this function outside of CONFIG_NET
    scope, we have to provide this function independently. The proposed
    solution is to move it under lib/net_utils.c with corresponding
    configuration variable and select wherever it is needed.

    Signed-off-by: Andy Shevchenko
    Reported-by: Arnd Bergmann
    Acked-by: David S. Miller
    Acked-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     

29 May, 2013

1 commit

  • So far, only net_device * could be passed along with netdevice notifier
    event. This patch provides a possibility to pass custom structure
    able to provide info that event listener needs to know.

    Signed-off-by: Jiri Pirko

    v2->v3: fix typo on simeth
    shortened dev_getter
    shortened notifier_info struct name
    v1->v2: fix notifier_call parameter in call_netdevice_notifier()
    Signed-off-by: David S. Miller

    Jiri Pirko
     

12 Mar, 2013

1 commit

  • __netpoll_cleanup() is called in netconsole_netdev_event() while holding a
    spinlock. Release/acquire the spinlock before/after it and restart the
    loop. Also, disable the netconsole completely, because we won't have chance
    after the restart of the loop, and might end up in a situation where
    nt->enabled == 1 and nt->np.dev == NULL.

    Signed-off-by: Veaceslav Falico
    Acked-by: Neil Horman
    Signed-off-by: David S. Miller

    Veaceslav Falico
     

09 Jan, 2013

2 commits

  • Currently, netpoll only supports IPv4. This patch adds IPv6
    support to netpoll so that we can run netconsole over IPv6 network.

    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     
  • This patch adjusts some struct and functions, to prepare
    for supporting IPv6.

    Cc: David S. Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

09 Nov, 2012

1 commit

  • Some people wants to log only oops messages via netconsole,
    (this is also why netoops was invented)
    so add a module option for netconsole. This can be tuned
    via /sys/module/netconsole/parameters/oops_only at run time
    as well.

    Cc: David Miller
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Amerigo Wang
     

20 Aug, 2012

1 commit

  • This netconsole_target_put() is obviously redundant, and it
    causes a kernel segfault when removing a bridge device which has
    netconsole running on it.

    This is caused by:

    commit 8d8fc29d02a33e4bd5f4fa47823c1fd386346093
    Author: Amerigo Wang
    Date: Thu May 19 21:39:10 2011 +0000

    netpoll: disable netpoll when enslave a device

    Cc: David Miller
    (for all 3.x stable releases)
    Cc: stable@vger.kernel.org
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Amerigo Wang
     

15 Aug, 2012

1 commit


01 Feb, 2012

1 commit


19 Oct, 2011

1 commit


21 Sep, 2011

1 commit

  • Commit 88491d8(drivers/net: Kconfig & Makefile cleanup) causes a
    regression that netconsole does not work if netconsole and network
    device driver are build into kernel, because netconsole is linked
    before network device driver.

    Andrew Morton suggested to fix this with initcall ordering.
    Fixes it by switching init_netconsole() to late_initcall.

    Signed-off-by: Lin Ming
    Signed-off-by: David S. Miller

    Lin Ming
     

23 May, 2011

2 commits

  • s/NETDEV_BONDING_DESLAVE/NETDEV_RELEASE/ as Andy suggested.

    Signed-off-by: WANG Cong
    Cc: Andy Gospodarek
    Cc: Neil Horman
    Signed-off-by: David S. Miller

    Amerigo Wang
     
  • V3: rename NETDEV_ENSLAVE to NETDEV_JOIN

    Currently we do nothing when we enslave a net device which is running netconsole.
    Neil pointed out that we may get weird results in such case, so let's disable
    netpoll on the device being enslaved. I think it is too harsh to prevent
    the device being ensalved if it is running netconsole.

    By the way, this patch also removes the NETDEV_GOING_DOWN from netconsole
    netdev notifier, because netpoll will check if the device is running or not
    and we don't handle NETDEV_PRE_UP neither.

    This patch is based on net-next-2.6.

    Signed-off-by: WANG Cong
    Cc: Neil Horman
    Signed-off-by: David S. Miller

    Amerigo Wang
     

10 May, 2011

2 commits

  • mac_pton() parses MAC address in form XX:XX:XX:XX:XX:XX and only in that form.

    mac_pton() doesn't dirty result until it's sure string representation is valid.

    mac_pton() doesn't care about characters _after_ last octet,
    it's up to caller to deal with it.

    mac_pton() diverges from 0/-E return value convention.
    Target usage:

    if (!mac_pton(str, whatever->mac))
    return -EINVAL;
    /* ->mac being u8 [ETH_ALEN] is filled at this point. */
    /* optionally check str[3 * ETH_ALEN - 1] for termination */

    Use mac_pton() in pktgen and netconsole for start.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

23 Apr, 2011

1 commit

  • A deadlock was reported to me recently that occured when netconsole was being
    used in a virtual guest. If the virtio_net driver was removed while netconsole
    was setup to use an interface that was driven by that driver, the guest
    deadlocked. No backtrace was provided because netconsole was the only console
    configured, but it became clear pretty quickly what the problem was. In
    netconsole_netdev_event, if we get an unregister event, we call
    __netpoll_cleanup with the target_list_lock held and irqs disabled.
    __netpoll_cleanup can, if pending netpoll packets are waiting call
    cancel_delayed_work_sync, which is a sleeping path. the might_sleep call in
    that path gets triggered, causing a console warning to be issued. The
    netconsole write handler of course tries to take the target_list_lock again,
    which we already hold, causing deadlock.

    The fix is pretty striaghtforward. Simply drop the target_list_lock and
    re-enable irqs prior to calling __netpoll_cleanup, the re-acquire the lock, and
    restart the loop. Confirmed by myself to fix the problem reported.

    Signed-off-by: Neil Horman
    CC: "David S. Miller"
    Signed-off-by: David S. Miller

    Neil Horman
     

07 Jan, 2011

2 commits


18 Oct, 2010

1 commit

  • Netconsole calls netpoll_cleanup on receipt of a NETDEVICE_UNREGISTER event.
    The notifier subsystem calls these event handlers with rtnl_lock held, which
    netpoll_cleanup also takes, resulting in deadlock. Fix this by calling the
    __netpoll_cleanup interior function instead, and fixing up the additional
    pointers.

    Signed-off-by: Neil Horman
    Signed-off-by: David S. Miller

    Neil Horman
     

06 May, 2010

1 commit

  • This whole patchset is for adding netpoll support to bridge and bonding
    devices. I already tested it for bridge, bonding, bridge over bonding,
    and bonding over bridge. It looks fine now.

    To make bridge and bonding support netpoll, we need to adjust
    some netpoll generic code. This patch does the following things:

    1) introduce two new priv_flags for struct net_device:
    IFF_IN_NETPOLL which identifies we are processing a netpoll;
    IFF_DISABLE_NETPOLL is used to disable netpoll support for a device
    at run-time;

    2) introduce one new method for netdev_ops:
    ->ndo_netpoll_cleanup() is used to clean up netpoll when a device is
    removed.

    3) introduce netpoll_poll_dev() which takes a struct net_device * parameter;
    export netpoll_send_skb() and netpoll_poll_dev() which will be used later;

    4) hide a pointer to struct netpoll in struct netpoll_info, ditto.

    5) introduce ->real_dev for struct netpoll.

    6) introduce a new status NETDEV_BONDING_DESLAE, which is used to disable
    netconsole before releasing a slave, to avoid deadlocks.

    Cc: David Miller
    Cc: Neil Horman
    Signed-off-by: WANG Cong
    Signed-off-by: David S. Miller

    WANG Cong
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

02 May, 2009

1 commit

  • When netconsole is loaded and a network interface fades away (e.g. on
    rmmod $interface_driver_module) the rmmod remains stuck and some locks
    are taken that prevent any additional module loading/unloading as well
    as interface up/down changes.
    In addition kernel logs (and console) get flooded at 10s interval with

    [ 122.464065] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
    [ 132.704059] unregister_netdevice: waiting for eth0 to become free. Usage count = 1

    This patch lets netconsole take NETDEV_UNREGISTER event into account
    and release the affected interface if it was in use.

    Signed-off-by: Bruno Prémont
    Acked-by: Matt Mackall
    Signed-off-by: David S. Miller

    Bruno Prémont
     

29 Mar, 2009

1 commit


28 Oct, 2008

1 commit

  • This converts pretty much everything to print_mac. There were
    a few things that had conflicts which I have just dropped for
    now, no harm done.

    I've built an allyesconfig with this and looked at the files
    that weren't built very carefully, but it's a huge patch.

    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

02 Aug, 2008

1 commit

  • Some module parameters with only one line have the '\n' at the end of the
    description. This is not needed nor wanted as after the description the
    type (i.e. int) is followed by a newline.

    Some modules contain a multi-line description, these are not affected
    by this patch.

    Signed-off-by: Niels de Vos
    Acked-by: Randy Dunlap
    Cc: John W. Linville
    Cc: Ed L. Cashin
    Cc: Dave Airlie
    Cc: Roland Dreier
    Acked-by: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Niels de Vos
     

18 Jul, 2008

2 commits