30 Sep, 2013

2 commits

  • kbasename() returns the filename part of a pathname.

    Signed-off-by: Andy Shevchenko

    Andy Shevchenko
     
  • It turns out the kernel relies on barrier() to force a reload of the
    percpu offset value. Since we can't easily modify the definition of
    barrier() to include "tp" as an output register, we instead provide a
    definition of __my_cpu_offset as extended assembly that includes a fake
    stack read to hazard against barrier(), forcing gcc to know that it
    must reread "tp" and recompute anything based on "tp" after a barrier.

    This fixes observed hangs in the slub allocator when we are looping
    on a percpu cmpxchg_double.

    A similar fix for ARMv7 was made in June in change 509eb76ebf97.

    Cc: stable@vger.kernel.org
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

28 Sep, 2013

3 commits


17 Sep, 2013

4 commits


13 Sep, 2013

7 commits

  • This should have been removed with commit 47d632f9f8f3, but
    it was overlooked.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • A config option to allow a variant vmap() using huge pages that was never
    upstreamed had some bits of code related to it scattered around the tile
    architecture; the config option was removed downstream and this commit
    cleans up the scattered evidence of it from the upstream as well.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • After the last architecture switched to generic hard irqs the config
    options HAVE_GENERIC_HARDIRQS & GENERIC_HARDIRQS and the related code
    for !CONFIG_GENERIC_HARDIRQS can be removed.

    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Unlike global OOM handling, memory cgroup code will invoke the OOM killer
    in any OOM situation because it has no way of telling faults occuring in
    kernel context - which could be handled more gracefully - from
    user-triggered faults.

    Pass a flag that identifies faults originating in user space from the
    architecture-specific fault handlers to generic code so that memcg OOM
    handling can be improved.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Cc: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     
  • The memcg code can trap tasks in the context of the failing allocation
    until an OOM situation is resolved. They can hold all kinds of locks
    (fs, mm) at this point, which makes it prone to deadlocking.

    This series converts memcg OOM handling into a two step process that is
    started in the charge context, but any waiting is done after the fault
    stack is fully unwound.

    Patches 1-4 prepare architecture handlers to support the new memcg
    requirements, but in doing so they also remove old cruft and unify
    out-of-memory behavior across architectures.

    Patch 5 disables the memcg OOM handling for syscalls, readahead, kernel
    faults, because they can gracefully unwind the stack with -ENOMEM. OOM
    handling is restricted to user triggered faults that have no other
    option.

    Patch 6 reworks memcg's hierarchical OOM locking to make it a little
    more obvious wth is going on in there: reduce locked regions, rename
    locking functions, reorder and document.

    Patch 7 implements the two-part OOM handling such that tasks are never
    trapped with the full charge stack in an OOM situation.

    This patch:

    Back before smart OOM killing, when faulting tasks were killed directly on
    allocation failures, the arch-specific fault handlers needed special
    protection for the init process.

    Now that all fault handlers call into the generic OOM killer (see commit
    609838cfed97: "mm: invoke oom-killer from remaining unconverted page
    fault handlers"), which already provides init protection, the
    arch-specific leftovers can be removed.

    Signed-off-by: Johannes Weiner
    Reviewed-by: Michal Hocko
    Acked-by: KOSAKI Motohiro
    Cc: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: azurIt
    Acked-by: Vineet Gupta [arch/arc bits]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johannes Weiner
     

12 Sep, 2013

1 commit

  • Currently hugepage migration works well only for pmd-based hugepages
    (mainly due to lack of testing,) so we had better not enable migration of
    other levels of hugepages until we are ready for it.

    Some users of hugepage migration (mbind, move_pages, and migrate_pages) do
    page table walk and check pud/pmd_huge() there, so they are safe. But the
    other users (softoffline and memory hotremove) don't do this, so without
    this patch they can try to migrate unexpected types of hugepages.

    To prevent this, we introduce hugepage_migration_support() as an
    architecture dependent check of whether hugepage are implemented on a pmd
    basis or not. And on some architecture multiple sizes of hugepages are
    available, so hugepage_migration_support() also checks hugepage size.

    Signed-off-by: Naoya Horiguchi
    Cc: Andi Kleen
    Cc: Hillf Danton
    Cc: Wanpeng Li
    Cc: Mel Gorman
    Cc: Hugh Dickins
    Cc: KOSAKI Motohiro
    Cc: Michal Hocko
    Cc: Rik van Riel
    Cc: "Aneesh Kumar K.V"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

07 Sep, 2013

4 commits

  • Pull ARM SoC platform changes from Olof Johansson:
    "This branch contains mostly additions and changes to platform
    enablement and SoC-level drivers. Since there's sometimes a
    dependency on device-tree changes, there's also a fair amount of
    those in this branch.

    Pieces worth mentioning are:

    - Mbus driver for Marvell platforms, allowing kernel configuration
    and resource allocation of on-chip peripherals.
    - Enablement of the mbus infrastructure from Marvell PCI-e drivers.
    - Preparation of MSI support for Marvell platforms.
    - Addition of new PCI-e host controller driver for Tegra platforms
    - Some churn caused by sharing of macro names between i.MX 6Q and 6DL
    platforms in the device tree sources and header files.
    - Various suspend/PM updates for Tegra, including LP1 support.
    - Versatile Express support for MCPM, part of big little support.
    - Allwinner platform support for A20 and A31 SoCs (dual and quad
    Cortex-A7)
    - OMAP2+ support for DRA7, a new Cortex-A15-based SoC.

    The code that touches other architectures are patches moving MSI
    arch-specific functions over to weak symbols and removal of
    ARCH_SUPPORTS_MSI, acked by PCI maintainers"

    * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (266 commits)
    tegra-cpuidle: provide stub when !CONFIG_CPU_IDLE
    PCI: tegra: replace devm_request_and_ioremap by devm_ioremap_resource
    ARM: tegra: Drop ARCH_SUPPORTS_MSI and sort list
    ARM: dts: vf610-twr: enable i2c0 device
    ARM: dts: i.MX51: Add one more I2C2 pinmux entry
    ARM: dts: i.MX51: Move pins configuration under "iomuxc" label
    ARM: dtsi: imx6qdl-sabresd: Add USB OTG vbus pin to pinctrl_hog
    ARM: dtsi: imx6qdl-sabresd: Add USB host 1 VBUS regulator
    ARM: dts: imx27-phytec-phycore-som: Enable AUDMUX
    ARM: dts: i.MX27: Disable AUDMUX in the template
    ARM: dts: wandboard: Add support for SDIO bcm4329
    ARM: i.MX5 clocks: Remove optional clock setup (CKIH1) from i.MX51 template
    ARM: dts: imx53-qsb: Make USBH1 functional
    ARM i.MX6Q: dts: Enable I2C1 with EEPROM and PMIC on Phytec phyFLEX-i.MX6 Ouad module
    ARM i.MX6Q: dts: Enable SPI NOR flash on Phytec phyFLEX-i.MX6 Ouad module
    ARM: dts: imx6qdl-sabresd: Add touchscreen support
    ARM: imx: add ocram clock for imx53
    ARM: dts: imx: ocram size is different between imx6q and imx6dl
    ARM: dts: imx27-phytec-phycore-som: Fix regulator settings
    ARM: dts: i.MX27: Remove clock name from CPU node
    ...

    Linus Torvalds
     
  • Pull Tile arch updates from Chris Metcalf:
    "These changes bring in a bunch of new functionality that has been
    maintained internally at Tilera over the last year, plus other stray
    bits of work that I've taken into the tile tree from other folks.

    The changes include some PCI root complex work, interrupt-driven
    console support, support for performing fast-path unaligned data
    fixups by kernel-based JIT code generation, CONFIG_PREEMPT support,
    vDSO support for gettimeofday(), a serial driver for the tilegx
    on-chip UART, KGDB support, more optimized string routines, support
    for ftrace and kprobes, improved ASLR, and many bug fixes.

    We also remove support for the old TILE64 chip, which is no longer
    buildable"

    * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (85 commits)
    tile: refresh tile defconfig files
    tile: rework
    tile PCI RC: make default consistent DMA mask 32-bit
    tile: add null check for kzalloc in tile/kernel/setup.c
    tile: make __write_once a synonym for __read_mostly
    tile: remove support for TILE64
    tile: use asm-generic/bitops/builtin-*.h
    tile: eliminate no-op "noatomichash" boot argument
    tile: use standard tile_bundle_bits type in traps.c
    tile: simplify code referencing hypervisor API addresses
    tile: change to in comments
    tile: mark pcibios_init() as __init
    tile: check for correct compiler earlier in asm-offsets.c
    tile: use standard 'generic-y' model for
    tile: use asm-generic version of
    tile PCI RC: add comment about "PCI hole" problem
    tile: remove DEBUG_EXTRA_FLAGS kernel config option
    tile: add virt_to_kpte() API and clean up and document behavior
    tile: support FRAME_POINTER
    tile: support reporting Tilera hypervisor statistics
    ...

    Linus Torvalds
     
  • These are based on the current shipping versions of the config files
    from Tilera, as synced up to the tip, so are a better starting point
    for folks who want a default configuration.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • The macrology in cmpxchg.h was designed to allow arbitrary pointer
    and integer values to be passed through the routines. To support
    cmpxchg() on 64-bit values on the 32-bit tilepro architecture, we
    used the idiom "(typeof(val))(typeof(val-val))". This way, in the
    "size 8" branch of the switch, when the underlying cmpxchg routine
    returns a 64-bit quantity, we cast it first to a typeof(val-val)
    quantity (i.e. size_t if "val" is a pointer) with no warnings about
    casting between pointers and integers of different sizes, then cast
    onwards to typeof(val), again with no warnings. If val is not a
    pointer type, the additional cast is a no-op. We can't replace the
    typeof(val-val) cast with (for example) unsigned long, since then if
    "val" is really a 64-bit type, we cast away the high bits.

    HOWEVER, this fails with current gcc (through 4.7 at least) if "val"
    is a pointer to an incomplete type. Unfortunately gcc isn't smart
    enough to realize that "val - val" will always be a size_t type
    even if it's an incomplete type pointer.

    Accordingly, I've reworked the way we handle the casting. We have
    given up the ability to use cmpxchg() on 64-bit values on tilepro,
    which is OK in the kernel since we should use cmpxchg64() explicitly
    on such values anyway. As a result, I can just use simple "unsigned
    long" casts internally.

    As I reworked it, I realized it would be cleaner to move the
    architecture-specific conditionals for cmpxchg and xchg out of the
    atomic.h headers and into cmpxchg, and then use the cmpxchg() and
    xchg() primitives directly in atomic.h and elsewhere. This allowed
    the cmpxchg.h header to stand on its own without relying on the
    implicit include of it that is performed by .
    It also allowed collapsing the atomic_xchg/atomic_cmpxchg routines
    from atomic_{32,64}.h into atomic.h.

    I improved the tests that guard the allowed size of the arguments
    to the routines to use a __compiletime_error() test. (By avoiding
    the use of BUILD_BUG, I could include cmpxchg.h into bitops.h as
    well and use the macros there, which is otherwise impossible due
    to include order dependency issues.)

    The tilepro _atomic_xxx internal methods were previously set up to
    take atomic_t and atomic64_t arguments, which isn't as convenient
    with the new model, so I modified them to take int or u64 arguments,
    which is consistent with how they used the arguments internally
    anyway, so provided some nice simplification there too.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

06 Sep, 2013

1 commit

  • Pull networking changes from David Miller:
    "Noteworthy changes this time around:

    1) Multicast rejoin support for team driver, from Jiri Pirko.

    2) Centralize and simplify TCP RTT measurement handling in order to
    reduce the impact of bad RTO seeding from SYN/ACKs. Also, when
    both timestamps and local RTT measurements are available prefer
    the later because there are broken middleware devices which
    scramble the timestamp.

    From Yuchung Cheng.

    3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel
    memory consumed to queue up unsend user data. From Eric Dumazet.

    4) Add a "physical port ID" abstraction for network devices, from
    Jiri Pirko.

    5) Add a "suppress" operation to influence fib_rules lookups, from
    Stefan Tomanek.

    6) Add a networking development FAQ, from Paul Gortmaker.

    7) Extend the information provided by tcp_probe and add ipv6 support,
    from Daniel Borkmann.

    8) Use RCU locking more extensively in openvswitch data paths, from
    Pravin B Shelar.

    9) Add SCTP support to openvswitch, from Joe Stringer.

    10) Add EF10 chip support to SFC driver, from Ben Hutchings.

    11) Add new SYNPROXY netfilter target, from Patrick McHardy.

    12) Compute a rate approximation for sending in TCP sockets, and use
    this to more intelligently coalesce TSO frames. Furthermore, add
    a new packet scheduler which takes advantage of this estimate when
    available. From Eric Dumazet.

    13) Allow AF_PACKET fanouts with random selection, from Daniel
    Borkmann.

    14) Add ipv6 support to vxlan driver, from Cong Wang"

    Resolved conflicts as per discussion.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits)
    openvswitch: Fix alignment of struct sw_flow_key.
    netfilter: Fix build errors with xt_socket.c
    tcp: Add missing braces to do_tcp_setsockopt
    caif: Add missing braces to multiline if in cfctrl_linkup_request
    bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize
    vxlan: Fix kernel panic on device delete.
    net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls
    net: mvneta: properly disable HW PHY polling and ensure adjust_link() works
    icplus: Use netif_running to determine device state
    ethernet/arc/arc_emac: Fix huge delays in large file copies
    tuntap: orphan frags before trying to set tx timestamp
    tuntap: purge socket error queue on detach
    qlcnic: use standard NAPI weights
    ipv6:introduce function to find route for redirect
    bnx2x: VF RSS support - VF side
    bnx2x: VF RSS support - PF side
    vxlan: Notify drivers for listening UDP port changes
    net: usbnet: update addr_assign_type if appropriate
    driver/net: enic: update enic maintainers and driver
    driver/net: enic: Exposing symbols for Cisco's low latency driver
    ...

    Linus Torvalds
     

04 Sep, 2013

18 commits

  • Pull PCI changes from Bjorn Helgaas:

    PCI device hotplug:
    - Use PCIe native hotplug, not ACPI hotplug, when possible (Neil Horman)
    - Assign resources on per-host bridge basis (Yinghai Lu)

    MPS (Max Payload Size):
    - Allow larger MPS settings below hotplug-capable Root Port (Yijing Wang)
    - Add warnings about unsafe MPS settings (Yijing Wang)
    - Simplify interface and messages (Bjorn Helgaas)

    SR-IOV:
    - Return -ENOSYS on non-SR-IOV devices (Stefan Assmann)
    - Update NumVFs register when disabling SR-IOV (Yijing Wang)

    Virtualization:
    - Add bus and slot reset support (Alex Williamson)
    - Fix ACS (Access Control Services) issues (Alex Williamson)

    Miscellaneous:
    - Simplify PCIe Capability accessors (Bjorn Helgaas)
    - Add pcibios_pm_ops for arch-specific hibernate stuff (Sebastian Ott)
    - Disable decoding during BAR sizing only when necessary (Zoltan Kiss)
    - Delay enabling bridges until they're needed (Yinghai Lu)
    - Split Designware support into Synopsys and Exynos parts (Jingoo Han)
    - Convert class code to use dev_groups (Greg Kroah-Hartman)
    - Cleanup Designware and Exynos I/O access wrappers (Seungwon Jeon)
    - Fix bridge I/O window alignment (Bjorn Helgaas)
    - Add pci_wait_for_pending_transaction() (Casey Leedom)
    - Use devm_ioremap_resource() in Marvell driver (Tushar Behera)

    * tag 'pci-v3.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (63 commits)
    PCI/ACPI: Fix _OSC ordering to allow PCIe hotplug use when available
    PCI: exynos: Add I/O access wrappers
    PCI: designware: Drop "addr" arg from dw_pcie_readl_rc()/dw_pcie_writel_rc()
    PCI: Remove pcie_cap_has_devctl()
    PCI: Support PCIe Capability Slot registers only for ports with slots
    PCI: Remove PCIe Capability version checks
    PCI: Allow PCIe Capability link-related register access for switches
    PCI: Add offsets of PCIe capability registers
    PCI: Tidy bitmasks and spacing of PCIe capability definitions
    PCI: Remove obsolete comment reference to pci_pcie_cap2()
    PCI: Clarify PCI_EXP_TYPE_PCI_BRIDGE comment
    PCI: Rename PCIe capability definitions to follow convention
    PCI: Warn if unsafe MPS settings detected
    PCI: Fix MPS peer-to-peer DMA comment syntax
    PCI: Disable decoding for BAR sizing only when it was actually enabled
    PCI: Add comment about needing pci_msi_off() even when CONFIG_PCI_MSI=n
    PCI: Add pcibios_pm_ops for optional arch-specific hibernate functionality
    PCI: Don't restrict MPS for slots below Root Ports
    PCI: Simplify MPS test for Downstream Port
    PCI: Remove unnecessary check for pcie_get_mps() failure
    ...

    Linus Torvalds
     
  • This change sets the PCI devices' initial DMA capabilities
    conservatively and promotes them at the request of the driver,
    as opposed to assuming advanced DMA capabilities. The old design
    runs the risk of breaking drivers that assume default capabilities.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Should check the return value of kzalloc first to avoid the null pointer.
    Then can dereference the non-null pointer to access the fields of struct
    resource.

    Signed-off-by: Wang Sheng-Hui
    Signed-off-by: Chris Metcalf

    Wang Sheng-Hui
     
  • This was really only useful for TILE64 when we mapped the
    kernel data with small pages. Now we use a huge page and we
    really don't want to map different parts of the kernel
    data in different ways.

    We retain the __write_once name in case we want to bring
    it back to life at some point in the future.

    Note that this change uncovered a latent bug where the
    "smp_topology" variable happened to always be aligned mod 8
    so we could store two "int" values at once, but when we
    eliminated __write_once it ended up only aligned mod 4.
    Fix with an explicit annotation.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • This chip is no longer being actively developed for (it was superceded
    by the TILEPro64 in 2008), and in any case the existing compiler and
    toolchain in the community do not support it. It's unlikely that the
    kernel works with TILE64 at this point as the configuration has not been
    tested in years. The support is also awkward as it requires maintaining
    a significant number of ifdefs. So, just remove it altogether.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • The definisions of __ffs(), __fls(), and ffs() for tile are almost same
    as asm-generic/bitops-*.h. The only difference is that it is defined
    as __always_inline or inline. So this switches to use those headers.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Chris Metcalf [moved #includes to end]

    Akinobu Mita
     
  • Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • We were rolling our own bundle_bits, which is unnecessary.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • There's no need to make up new ways of computing the addresses
    of the Tilera hypervisor APIs; just use the standard method
    of relying on the symbols to provide the addresses.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Also fix mentions of it in #error statements.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • It was bombed away because it was previously marked as __devinit,
    but it should be an __init function.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • If we wait until after including a bunch of other files, we
    will have generated so much warning spew that it's hard to
    notice the error about using the wrong compiler.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Explain the rationale of not overlapping the 64-bit DMA window
    with the PA range.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • It isn't used any more by us now that the generic kernel build
    offers DEBUG_INFO_REDUCED, so just get rid of it.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • We use virt_to_pte(NULL, va) a lot, which isn't very obvious.
    I added virt_to_kpte(va) as a more obvious wrapper function,
    that also validates the va as being a kernel adddress.

    And, I fixed the semantics of virt_to_pte() so that we handle
    the pud and pmd the same way, and we now document the fact that
    we handle the final pte level differently.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Allow enabling frame pointer support; this makes it easier to hook
    into the various kernel features that claim they require it without
    having to add Kconfig conditionals everywhere (a la mips, ppc, s390,
    and microblaze). When enabled, it basically eliminates leaf functions
    as such, and stops optimizing tail and sibling calls. It adds around
    3% to the size of the kernel when enabled.

    Signed-off-by: Chris Metcalf

    Chris Metcalf