21 May, 2014

1 commit

  • The DMA-API documentation sometimes refers to "physical addresses" when it
    really means "bus addresses." Sometimes these are identical, but they may
    be different if the bridge leading to the bus performs address translation.
    Update the documentation to use "bus address" when appropriate.

    Also, consistently capitalize "DMA", use parens with function names, use
    dev_printk() in examples, and reword a few sections for clarity.

    No functional change; documentation changes only.

    Signed-off-by: Bjorn Helgaas
    Acked-by: Greg Kroah-Hartman
    Acked-by: Arnd Bergmann
    Acked-by: James Bottomley
    Acked-by: Randy Dunlap

    Bjorn Helgaas
     

12 Dec, 2012

1 commit

  • test_set_oom_score_adj() and compare_swap_oom_score_adj() are used to
    specify that current should be killed first if an oom condition occurs in
    between the two calls.

    The usage is

    short oom_score_adj = test_set_oom_score_adj(OOM_SCORE_ADJ_MAX);
    ...
    compare_swap_oom_score_adj(OOM_SCORE_ADJ_MAX, oom_score_adj);

    to store the thread's oom_score_adj, temporarily change it to the maximum
    score possible, and then restore the old value if it is still the same.

    This happens to still be racy, however, if the user writes
    OOM_SCORE_ADJ_MAX to /proc/pid/oom_score_adj in between the two calls.
    The compare_swap_oom_score_adj() will then incorrectly reset the old value
    prior to the write of OOM_SCORE_ADJ_MAX.

    To fix this, introduce a new oom_flags_t member in struct signal_struct
    that will be used for per-thread oom killer flags. KSM and swapoff can
    now use a bit in this member to specify that threads should be killed
    first in oom conditions without playing around with oom_score_adj.

    This also allows the correct oom_score_adj to always be shown when reading
    /proc/pid/oom_score.

    Signed-off-by: David Rientjes
    Cc: KAMEZAWA Hiroyuki
    Cc: KOSAKI Motohiro
    Reviewed-by: Michal Hocko
    Cc: Anton Vorontsov
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Rientjes
     

13 Oct, 2012

1 commit


23 Jul, 2012

1 commit


31 May, 2012

1 commit


11 Apr, 2012

1 commit

  • It makes no sense to export this trivial function. Make it a static inline
    instead.

    This patch also drops virq_to_hw from arch/c6x since it is unused by that
    architecture.

    v2: Move irq_hw_number_t into types.h to fix ARM build failure

    Signed-off-by: Grant Likely
    Acked-by: Thomas Gleixner
    Cc: Benjamin Herrenschmidt

    Grant Likely
     

09 Jan, 2012

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     

04 Jan, 2012

1 commit


12 Dec, 2011

1 commit


29 Sep, 2011

1 commit

  • Take a first step towards untangling Linux kernel header files by
    placing the struct rcu_head definition into include/linux/types.h
    and including include/linux/types.h in include/linux/rcupdate.h
    where struct rcu_head used to be defined. The actual inclusion point
    for include/linux/types.h is with the rest of the #include directives
    rather than at the point where struct rcu_head used to be defined,
    as suggested by Mathieu Desnoyers.

    Once this is in place, then header files that need only rcu_head
    can include types.h rather than rcupdate.h.

    Signed-off-by: Paul E. McKenney
    Cc: Paul Gortmaker
    Acked-by: Mathieu Desnoyers

    Paul E. McKenney
     

23 Mar, 2011

1 commit

  • All architectures can use the common dma_addr_t typedef now. We can
    remove the arch specific dma_addr_t.

    Signed-off-by: FUJITA Tomonori
    Acked-by: Arnd Bergmann
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Ivan Kokshaysky
    Cc: Richard Henderson
    Cc: Matt Turner
    Cc: "Luck, Tony"
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Chris Metcalf
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    FUJITA Tomonori
     

27 Oct, 2010

1 commit


16 Oct, 2010

1 commit

  • We currently have a kernel internal type called aligned_u64 which aligns
    __u64's on 8 bytes boundaries even on systems which would normally align
    them on 4 byte boundaries. This patch creates a new type __aligned_u64
    which does the same thing but which is exposed to userspace rather than
    being kernel internal.

    [akpm: merge early as both the net and audit trees want this]

    [akpm@linux-foundation.org: enhance the comment describing the reasons for using aligned_u64. Via Andreas and Andi.]
    Based-on-patch-by: Andreas Gruenbacher
    Signed-off-by: Eric Paris
    Cc: Jan Engelhardt
    Cc: David Miller
    Cc: Andi Kleen
    Cc: Arnd Bergmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Paris
     

06 Aug, 2010

1 commit


12 Jul, 2010

1 commit

  • Move the preprocessor #warning message:
    warning: #warning Attempt to use kernel headers from user space,
    see http://kernelnewbies.org/KernelHeaders
    from kernel.h to types.h.

    And also fixe the #warning message due to the preprocessor not being able to
    read the web address due to it thinking it was the start of a comment. also
    remove the extra #ifndef _KERNEL_ since it's already there.

    Signed-off-by: Justin P. Mattock
    Cc: Arnd Bergmann
    Signed-off-by: Jiri Kosina

    Justin P. Mattock
     

07 Jul, 2010

1 commit

  • This allows a list_head (or hlist_head, etc.) to be used from places
    that used to be impractical, in particular , which
    used to cause include file recursion: includes
    , which always includes for the
    prefetch macros, as well as , which often includes
    directly or indirectly.

    This avoids a lot of painful workaround hackery on the tile
    architecture, where we use a list_head in the thread_struct to chain
    together tasks that are activated on a particular hardwall.

    Signed-off-by: Chris Metcalf
    Reviewed-by: Matthew Wilcox

    Chris Metcalf
     

17 May, 2010

1 commit

  • When looking at a performance problem on PowerPC, I noticed some awful code
    generation:

    c00000000051fc98: 3b 60 00 01 li r27,1
    ...
    c00000000051fca0: 3b 80 00 00 li r28,0
    ...
    c00000000051fcdc: 93 61 00 70 stw r27,112(r1)
    c00000000051fce0: 93 81 00 74 stw r28,116(r1)
    c00000000051fce4: 81 21 00 70 lwz r9,112(r1)
    c00000000051fce8: 80 01 00 74 lwz r0,116(r1)
    c00000000051fcec: 7d 29 07 b4 extsw r9,r9
    c00000000051fcf0: 7c 00 07 b4 extsw r0,r0

    c00000000051fcf4: 7c 20 04 ac lwsync
    c00000000051fcf8: 7d 60 f8 28 lwarx r11,0,r31
    c00000000051fcfc: 7c 0b 48 00 cmpw r11,r9
    c00000000051fd00: 40 c2 00 10 bne- c00000000051fd10
    c00000000051fd04: 7c 00 f9 2d stwcx. r0,0,r31
    c00000000051fd08: 40 c2 ff f0 bne+ c00000000051fcf8
    c00000000051fd0c: 4c 00 01 2c isync

    We create two constants, write them out to the stack, read them straight back
    in and sign extend them. What a mess.

    It turns out this bad code is a result of us defining atomic_t as a
    volatile int.

    We removed the volatile attribute from the powerpc atomic_t definition years
    ago, but commit ea435467500612636f8f4fb639ff6e76b2496e4b (atomic_t: unify all
    arch definitions) added it back in.

    To dig up an old quote from Linus:

    > The fact is, volatile on data structures is a bug. It's a wart in the C
    > language. It shouldn't be used.
    >
    > Volatile accesses in *code* can be ok, and if we have "atomic_read()"
    > expand to a "*(volatile int *)&(x)->value", then I'd be ok with that.
    >
    > But marking data structures volatile just makes the compiler screw up
    > totally, and makes code for initialization sequences etc much worse.

    And screw up it does :)

    With the volatile removed, we see much more reasonable code generation:

    c00000000051f5b8: 3b 60 00 01 li r27,1
    ...
    c00000000051f5c0: 3b 80 00 00 li r28,0
    ...

    c00000000051fc7c: 7c 20 04 ac lwsync
    c00000000051fc80: 7c 00 f8 28 lwarx r0,0,r31
    c00000000051fc84: 7c 00 d8 00 cmpw r0,r27
    c00000000051fc88: 40 c2 00 10 bne- c00000000051fc98
    c00000000051fc8c: 7f 80 f9 2d stwcx. r28,0,r31
    c00000000051fc90: 40 c2 ff f0 bne+ c00000000051fc80
    c00000000051fc94: 4c 00 01 2c isync

    Six instructions less.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     

19 Jun, 2009

1 commit

  • Follow-up to "block: enable by default support for large devices
    and files on 32-bit archs".

    Rename CONFIG_LBD to CONFIG_LBDAF to:
    - allow update of existing [def]configs for "default y" change
    - reflect that it is used also for large files support nowadays

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Jens Axboe

    Bartlomiej Zolnierkiewicz
     

27 Mar, 2009

2 commits


06 Feb, 2009

1 commit


08 Jan, 2009

1 commit


07 Jan, 2009

1 commit

  • The atomic_t type cannot currently be used in some header files because it
    would create an include loop with asm/atomic.h. Move the type definition
    to linux/types.h to break the loop.

    Signed-off-by: Matthew Wilcox
    Cc: Huang Ying
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

29 Dec, 2008

1 commit

  • We have two seperate config entries for large devices/files. One
    is CONFIG_LBD that guards just the devices, the other is CONFIG_LSF
    that handles large files. This doesn't make a lot of sense, you typically
    want both or none. So get rid of CONFIG_LSF and change CONFIG_LBD wording
    to indicate that it covers both.

    Acked-by: Jean Delvare
    Signed-off-by: Jens Axboe

    Jens Axboe
     

21 Oct, 2008

1 commit


14 Sep, 2008

2 commits


25 May, 2008

1 commit

  • can't be used together with because they
    both define struct ustat:

    $ cat test.c
    #include
    #include
    $ gcc -c test.c
    In file included from test.c:2:
    /usr/include/linux/types.h:165: error: redefinition of 'struct ustat'

    has been reported a while ago to debian, but seems to have been
    lost in cat fighting: http://bugs.debian.org/429064

    Signed-off-by: maximilian attems
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    maximilian attems
     

09 Feb, 2008

1 commit


01 Feb, 2008

1 commit


29 Oct, 2007

1 commit

  • Use of ptrdiff_t in places like

    - if (!access_ok(VERIFY_WRITE, u_tmp->rx_buf, u_tmp->len))
    + if (!access_ok(VERIFY_WRITE, (u8 __user *)
    + (ptrdiff_t) u_tmp->rx_buf,
    + u_tmp->len))

    is wrong; for one thing, it's a bad C (it's what uintptr_t is for; in general
    we are not even promised that ptrdiff_t is large enough to hold a pointer,
    just enough to hold a difference between two pointers within the same object).
    For another, it confuses the fsck out of sparse.

    Use unsigned long or uintptr_t instead. There are several places misusing
    ptrdiff_t; fixed.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

20 Oct, 2007

1 commit

  • define first set of BIT* macros

    - move BITOP_MASK and BITOP_WORD from asm-generic/bitops/atomic.h to
    include/linux/bitops.h and rename it to BIT_MASK and BIT_WORD
    - move BITS_TO_LONGS and BITS_PER_BYTE to bitops.h too and allow easily
    define another BITS_TO_something (e.g. in event.c) by BITS_TO_TYPE macro
    Remaining (and common) BIT macro will be defined after all occurences and
    conflicts will be sorted out in the patches.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

05 Dec, 2006

1 commit

  • CONFIG_LBD and CONFIG_LSF are spread into asm/types.h for no particularly
    good reason.

    Centralising the definition in linux/types.h means that arch maintainers
    don't need to bother adding it, as well as fixing the problem with
    x86-64 users being asked to make a decision that has absolutely no
    effect.

    The H8/300 porters seem particularly confused since I'm not aware of any
    microcontrollers that need to support 2TB filesystems.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: Linus Torvalds

    Matthew Wilcox
     

03 Dec, 2006

2 commits


05 Oct, 2006

1 commit


01 Oct, 2006

1 commit

  • This patch defines:
    * a generic boolean-type, named 'bool'
    * aliases to 0 and 1, named 'false' and 'true'

    Removing colliding definitions of 'bool', 'false' and 'true'.

    Signed-off-by: Richard Knutsson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Knutsson
     

28 Jun, 2006

2 commits


26 Apr, 2006

1 commit