[PATCH RESEND 0/3] partitions: efi: tighten gpt header integrity checks

2012-10-25 Thread Davidlohr Bueso
Hi Jens, This is a resend of a patchset sent in early September to harden GPT header checks. partitions: efi: check minimum header size partitions: efi: verify header is outside usable area partitions: efi: compare first and last usable LBAs block/partitions/efi.c | 20

[PATCH RESEND 1/3] partitions: efi: compare first and last usable LBAs

2012-10-25 Thread Davidlohr Bueso
When verifying GPT header integrity, make sure that first usable LBA is smaller than last usable LBA. Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/block/partitions/efi.c b/block/partitions/efi.c index 6296b40

[PATCH RESEND 2/3] partitions: efi: verify header is outside usable area

2012-10-25 Thread Davidlohr Bueso
The first usable logical block can be used by a GUID partition entry, and therefore cannot be used by the header. Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/block/partitions/efi.c b/block/partitions/efi.c

[PATCH RESEND 3/3] partitions: efi: check minimum header size

2012-10-25 Thread Davidlohr Bueso
As per UEFI specs 2.3.1 (June 2012), The Header Size must be greater than 92 and must be less than or equal to the logical block size Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block

[PATCH] x86, amd: rename vmmu support capability

2012-07-13 Thread Davidlohr Bueso
From: Davidlohr Bueso d...@gnu.org AMD has renamed nested page table technology to rapid virtualization indexing, reflect this change in the kernel. Signed-off-by: Davidlohr Bueso d...@gnu.org --- arch/x86/include/asm/cpufeature.h |2 +- arch/x86/kernel/cpu/scattered.c |2 +- arch/x86

Re: [PATCH] x86, amd: rename vmmu support capability

2012-07-14 Thread Davidlohr Bueso
On Sat, 2012-07-14 at 12:19 +0200, Borislav Petkov wrote: On Fri, Jul 13, 2012 at 08:02:55PM +0200, Davidlohr Bueso wrote: From: Davidlohr Bueso d...@gnu.org AMD has renamed nested page table technology to rapid virtualization indexing, reflect this change in the kernel. Signed

Re: [PATCH] x86, amd: rename vmmu support capability

2012-07-14 Thread Davidlohr Bueso
On Sat, 2012-07-14 at 15:38 +0200, H. Peter Anvin wrote: Yep, NAK on this one. Ok, we could at least add a comment when defining X86_FEATURE_NPT. Thanks, Davidlohr Borislav Petkov b...@alien8.de wrote: On Fri, Jul 13, 2012 at 08:02:55PM +0200, Davidlohr Bueso wrote: From: Davidlohr

Re: [PATCH v2 2/3] mutex: Queue mutex spinners with MCS lock to reduce cacheline contention

2013-04-15 Thread Davidlohr Bueso
On Mon, 2013-04-15 at 10:37 -0400, Waiman Long wrote: [...] +typedef struct mspin_node { + struct mspin_node *next; + intlocked; /* 1 if lock acquired */ +} mspin_node_t; + +typedef mspin_node_t *mspin_lock_t; I think we could do without the typedefs, specially

Re: [PATCH v4 3/4] mutex: Queue mutex spinners with MCS lock to reduce cacheline contention

2013-04-17 Thread Davidlohr Bueso
in performance probably due to the spinner locking and queuing overhead. Signed-off-by: Waiman Long waiman.l...@hp.com Acked-by: Rik van Riel r...@redhat.com Reviewed-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: linux-next: Tree for Apr 18 [ call-trace: drm | x86 | smp | rcu related? ]

2013-04-19 Thread Davidlohr Bueso
On Fri, 2013-04-19 at 15:19 -0400, Rik van Riel wrote: On 04/19/2013 02:53 PM, Sedat Dilek wrote: On Fri, Apr 19, 2013 at 6:43 PM, Sedat Dilek sedat.di...@gmail.com wrote: I tried to switch from SLUB to SLAB... ...and also from VIRT_CPU_ACCOUNTING_GEN to TICK_CPU_ACCOUNTING. 2x

Re: linux-next: Tree for Apr 18 [ call-trace: drm | x86 | smp | rcu related? ]

2013-04-20 Thread Davidlohr Bueso
: Davidlohr pointed to this patch (tested the triplet): ipc, sem: do not call sem_lock when bogus sma: https://lkml.org/lkml/2013/3/31/12 Is that what you mean? Yup. Davidlohr Bueso (1): ipc, sem: do not call sem_lock when bogus sma Linus Torvalds (1): crazy rcu

Re: [PATCH -mm -next] ipc,sem: untangle RCU locking with find_alloc_undo

2013-03-28 Thread Davidlohr Bueso
)); if (error = 0) { Reviewed-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http

[PATCH v2 1/2] rbtree_test: add extra rbtree integrity check

2013-03-29 Thread Davidlohr Bueso
Account for the rbtree having 2**bh(v)-1 internal nodes. While this can be seen as a consequence of other checks, Michel states that it nicely sums up what the other properties are for. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rbtree_test.c | 5 +++-- 1 file changed, 3

[PATCH v2 2/2] rbtree_test: add __init/__exit annotations

2013-03-29 Thread Davidlohr Bueso
Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rbtree_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index 9951503..122f02f 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -149,7 +149,7 @@ static void

Re: ipc,sem: sysv semaphore scalability

2013-03-29 Thread Davidlohr Bueso
On Sat, 2013-03-30 at 08:36 +0700, Emmanuel Benisty wrote: Hi Linus, On Sat, Mar 30, 2013 at 6:16 AM, Linus Torvalds torva...@linux-foundation.org wrote: Emmanuel, can you try the attached patch? I think it applies cleanly on top of the scalability series too without any changes, but I

Re: ipc,sem: sysv semaphore scalability

2013-03-29 Thread Davidlohr Bueso
On Fri, 2013-03-29 at 19:09 -0700, Linus Torvalds wrote: On Fri, Mar 29, 2013 at 6:36 PM, Emmanuel Benisty benist...@gmail.com wrote: I had to slightly modify the patch since it wouldn't match the changes introduced by 7-7-ipc-sem-fine-grained-locking-for-semtimedop.patch, hope that was

Re: [PATCH -mm -next] ipc,sem: untangle RCU locking with find_alloc_undo

2013-03-30 Thread Davidlohr Bueso
...@redhat.com Reviewed-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http

Re: ipc,sem: sysv semaphore scalability

2013-03-30 Thread Davidlohr Bueso
--- From: Davidlohr Bueso davidlohr.bu...@hp.com Subject: [PATCH] ipc, sem: do not call sem_lock when bogus sma In exit_sem() we attempt to acquire the sma-sem_perm.lock by calling sem_lock() immediately after obtaining sma. However, if sma isn't valid, then calling sem_lock() will tend to do bad

[PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-18 Thread Davidlohr Bueso
This provides nicer message output. Since it seems more appropriate for the nature of this module, also use KERN_INFO instead of other levels. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rbtree_test.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff

[PATCH 3/3] rbtree_test: add more rbtree integrity checks

2013-03-18 Thread Davidlohr Bueso
When checking the rbtree, account for more properties: - Both children of a red node are black. - The tree has at least 2**bh(v)-1 internal nodes. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rbtree_test.c | 24 +++- 1 file changed, 19 insertions(+), 5

[PATCH 2/3] rbtree_test: add __init/__exit annotations

2013-03-18 Thread Davidlohr Bueso
Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- lib/rbtree_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c index 66ca26d..0fea14e 100644 --- a/lib/rbtree_test.c +++ b/lib/rbtree_test.c @@ -151,7 +151,7 @@ static void

Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-18 Thread Davidlohr Bueso
On Mon, 2013-03-18 at 16:44 -0700, Joe Perches wrote: On Mon, 2013-03-18 at 16:20 -0700, Davidlohr Bueso wrote: This provides nicer message output. Since it seems more appropriate for the nature of this module, also use KERN_INFO instead of other levels. [] diff --git a/lib/rbtree_test.c

Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-19 Thread Davidlohr Bueso
On Tue, 2013-03-19 at 10:29 -0600, Shuah Khan wrote: On Mon, Mar 18, 2013 at 5:20 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: This provides nicer message output. Since it seems more appropriate for the nature of this module, also use KERN_INFO instead of other levels. Why are you

Re: ipc,sem: sysv semaphore scalability

2013-03-20 Thread Davidlohr Bueso
On Wed, 2013-03-20 at 13:49 -0700, Linus Torvalds wrote: On Wed, Mar 20, 2013 at 12:55 PM, Rik van Riel r...@surriel.com wrote: This series makes the sysv semaphore code more scalable, by reducing the time the semaphore lock is held, and making the locking more scalable for semaphore

Re: ipc,sem: sysv semaphore scalability

2013-03-21 Thread Davidlohr Bueso
On Wed, 2013-03-20 at 15:55 -0400, Rik van Riel wrote: Include lkml in the CC: this time... *sigh* ---8--- This series makes the sysv semaphore code more scalable, by reducing the time the semaphore lock is held, and making the locking more scalable for semaphore arrays with multiple

Re: [PATCH 5/7] ipc,sem: open code and rename sem_lock

2013-03-21 Thread Davidlohr Bueso
for the sem_array in the next patch. Signed-off-by: Rik van Riel r...@redhat.com Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 6/7] ipc,sem: have only one list in struct sem_queue

2013-03-21 Thread Davidlohr Bueso
Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 7/7] ipc,sem: fine grained locking for semtimedop

2013-03-21 Thread Davidlohr Bueso
-by: Rik van Riel r...@redhat.com Suggested-by: Linus Torvalds torva...@linux-foundation.org Acked-by: Davidlohr Bueso davidlohr.bu...@hp.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-21 Thread Davidlohr Bueso
On Tue, 2013-03-19 at 11:54 -0600, Shuah Khan wrote: On Tue, Mar 19, 2013 at 11:14 AM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Tue, 2013-03-19 at 10:29 -0600, Shuah Khan wrote: On Mon, Mar 18, 2013 at 5:20 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: This provides nicer

Re: ipc,sem: sysv semaphore scalability

2013-03-22 Thread Davidlohr Bueso
On Wed, 2013-03-20 at 15:55 -0400, Rik van Riel wrote: Include lkml in the CC: this time... *sigh* ---8--- This series makes the sysv semaphore code more scalable, by reducing the time the semaphore lock is held, and making the locking more scalable for semaphore arrays with multiple

Re: [PATCH 1/3] rbtree_test: use pr_info for module prefix in messages

2013-03-22 Thread Davidlohr Bueso
On Thu, 2013-03-21 at 20:29 -0700, Michel Lespinasse wrote: On Thu, Mar 21, 2013 at 7:51 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Tue, 2013-03-19 at 11:54 -0600, Shuah Khan wrote: On Tue, Mar 19, 2013 at 11:14 AM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: On Tue, 2013

Re: [PATCH 3/3] rbtree_test: add more rbtree integrity checks

2013-03-22 Thread Davidlohr Bueso
On Thu, 2013-03-21 at 20:36 -0700, Michel Lespinasse wrote: On Mon, Mar 18, 2013 at 4:21 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: When checking the rbtree, account for more properties: - Both children of a red node are black. - The tree has at least 2**bh(v)-1 internal

Re: ipc,sem: sysv semaphore scalability

2013-03-26 Thread Davidlohr Bueso
On Tue, 2013-03-26 at 13:33 -0400, Sasha Levin wrote: On 03/20/2013 03:55 PM, Rik van Riel wrote: This series makes the sysv semaphore code more scalable, by reducing the time the semaphore lock is held, and making the locking more scalable for semaphore arrays with multiple semaphores.

Re: ipc,sem: sysv semaphore scalability

2013-03-26 Thread Davidlohr Bueso
this up. Thanks. ---8--- From: Davidlohr Bueso davidlohr.bu...@hp.com Subject: [PATCH] ipc, sem: prevent possible deadlock In semctl_main(), when cmd == GETALL, we're locking sma-sem_perm.lock (through sem_lock_and_putref), yet after the conditional, we lock it again. Unlock sma right after

Re: [PATCH 2/2] ipc: semaphores: do not hold ipc lock more than necessary

2013-03-02 Thread Davidlohr Bueso
On Sat, 2013-03-02 at 12:41 +0800, Michel Lespinasse wrote: On Sat, Mar 2, 2013 at 8:16 AM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: Instead of holding the ipc lock for permissions and security checks, among others, only acquire it when necessary. Signed-off-by: Davidlohr Bueso

Re: [PATCH 2/2] ipc: semaphores: do not hold ipc lock more than necessary

2013-03-02 Thread Davidlohr Bueso
On Fri, 2013-03-01 at 17:20 -0800, Linus Torvalds wrote: On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: +static inline struct sem_array *sem_obtain_object(struct ipc_namespace *ns, int id) +{ + struct kern_ipc_perm *ipcp = ipc_obtain_object(sem_ids

Re: [RFC PATCH 0/2] ipc: do not hold ipc lock more than necessary

2013-03-02 Thread Davidlohr Bueso
On Sat, 2013-03-02 at 15:35 +0700, Emmanuel Benisty wrote: On Sat, Mar 2, 2013 at 2:08 PM, Michel Lespinasse wal...@google.com wrote: On Sat, Mar 2, 2013 at 12:43 PM, Emmanuel Benisty benist...@gmail.com wrote: Hi, On Sat, Mar 2, 2013 at 7:16 AM, Davidlohr Bueso davidlohr.bu...@hp.com

Re: [RFC PATCH 0/2] ipc: do not hold ipc lock more than necessary

2013-03-02 Thread Davidlohr Bueso
On Fri, 2013-03-01 at 17:32 -0800, Linus Torvalds wrote: On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: With Rik's semop-multi.c microbenchmark we can see the following results: Ok, that certainly looks very good. + 59.40%a.out

Re: [RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-02 Thread Davidlohr Bueso
On Sat, 2013-03-02 at 13:24 -0800, Linus Torvalds wrote: On Fri, Mar 1, 2013 at 4:16 PM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: @@ -784,7 +806,7 @@ struct kern_ipc_perm *ipcctl_pre_down(struct ipc_namespace *ns, int err; down_write(ids-rw_mutex); - ipcp

[PATCH v2 0/4] ipc: reduce ipc lock contention

2013-03-05 Thread Davidlohr Bueso
Hi, The following set of patches are based on the discussion of holding the ipc lock unnecessarily, such as for permissions and security checks: https://lkml.org/lkml/2013/2/28/540 Patch 1/4: Remove the bogus comment from ipc_checkid() requiring that the ipc lock be held before calling it.

[PATCH v2 1/4] ipc: remove bogus lock comment for ipc_checkid

2013-03-05 Thread Davidlohr Bueso
There is no reason to be holding the ipc lock while reading ipcp-seq, hence remove misleading comment. Also simplify the return value for the function. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- ipc/util.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git

[PATCH v2 4/4] ipc: sem: do not hold ipc lock more than necessary

2013-03-05 Thread Davidlohr Bueso
-by: Davidlohr Bueso davidlohr.bu...@hp.com Reviewed-by: Chegu Vinod chegu_vi...@hp.com Acked-by: Michel Lespinasse wal...@google.com CC: Rik van Riel r...@redhat.com CC: Jason Low jason.l...@hp.com CC: Emmanuel Benisty benist...@gmail.com --- ipc/sem.c | 157

[PATCH v2 2/4] ipc: introduce obtaining a lockless ipc object

2013-03-05 Thread Davidlohr Bueso
and return the ipc object. Both these functions must be called within the RCU read critical section. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com Reviewed-by: Chegu Vinod chegu_vi...@hp.com Acked-by: Michel Lespinasse wal...@google.com --- ipc/util.c | 71

[PATCH v2 3/4] ipc: introduce lockless pre_down ipcctl

2013-03-05 Thread Davidlohr Bueso
, without affecting its semantics, thus transparent to all ipc callers. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com Suggested-by: Linus Torvalds torva...@linux-foundation.org --- ipc/util.c | 31 ++- ipc/util.h | 3 +++ 2 files changed, 29 insertions(+), 5

Re: [PATCH v2 0/4] ipc: reduce ipc lock contention

2013-03-05 Thread Davidlohr Bueso
On Tue, 2013-03-05 at 07:40 -0800, Linus Torvalds wrote: On Tue, Mar 5, 2013 at 1:35 AM, Davidlohr Bueso davidlohr.bu...@hp.com wrote: The following set of patches are based on the discussion of holding the ipc lock unnecessarily, such as for permissions and security checks: Ok, looks

Re: [PATCH v2 0/4] ipc: reduce ipc lock contention

2013-03-05 Thread Davidlohr Bueso
On Tue, 2013-03-05 at 22:53 -0500, Rik van Riel wrote: On 03/05/2013 10:46 PM, Waiman Long wrote: On 03/05/2013 03:53 PM, Rik van Riel wrote: Indeed. Though how well my patches will work with Oracle will depend a lot on what kind of semctl syscalls they are doing. Does Oracle

Re: [PATCH v2 7/4] ipc: fine grained locking for semtimedop

2013-03-06 Thread Davidlohr Bueso
On Wed, 2013-03-06 at 17:15 -0500, Rik van Riel wrote: Introduce finer grained locking for semtimedop, to handle the common case of a program wanting to manipulate one semaphore from an array with multiple semaphores. Each semaphore array has a read/write lock. If something complex is going

[PATCH 1/2] zram: remove unexistant discard from sysfs ABI doc

2013-02-10 Thread Davidlohr Bueso
Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- Both patches apply on top of the staging-next branch of the staging tree. Documentation/ABI/testing/sysfs-block-zram | 9 - 1 file changed, 9 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-block-zram b/Documentation

[PATCH 2/2] zram: gather statistics in a unique file

2013-02-10 Thread Davidlohr Bueso
Notify free:0 Zero pages: 1042 Orig data size: 49152 bytes Compressed data:838 bytes Total memory used: 53248 bytes Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zram/zram.txt | 20 ++- drivers/staging/zram/zram_sysfs.c

Re: [PATCH 2/2] zram: gather statistics in a unique file

2013-02-10 Thread Davidlohr Bueso
Sorry, I forgot to include the updated ABI changes with this patch. Sending v2. On Sun, 2013-02-10 at 20:29 -0800, Davidlohr Bueso wrote: Instead of having one sysfs file per zram statistic, group them all in a single, reader-friendly, 'statistics' file. This not only reduces code but is also

[PATCH v2 2/2] zram: gather statistics in a unique file

2013-02-10 Thread Davidlohr Bueso
: 0 Notify free:0 Zero pages: 1042 Orig data size: 49152 bytes Compressed data:838 bytes Total memory used: 53248 bytes Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- Documentation/ABI/testing/sysfs-block-zram | 85

Re: [PATCH 2/2] zram: gather statistics in a unique file

2013-02-11 Thread Davidlohr Bueso
On Sun, 2013-02-10 at 21:41 -0800, Greg Kroah-Hartman wrote: On Sun, Feb 10, 2013 at 08:29:06PM -0800, Davidlohr Bueso wrote: Instead of having one sysfs file per zram statistic, group them all in a single, reader-friendly, 'statistics' file. This not only reduces code but is also makes

Re: [tip:core/locking] x86/smp: Move waiting on contended ticket lock out of line

2013-02-27 Thread Davidlohr Bueso
On Wed, 2013-02-27 at 21:58 -0500, Rik van Riel wrote: On 02/27/2013 05:13 PM, Linus Torvalds wrote: On Feb 27, 2013 1:56 PM, Rik van Riel r...@redhat.com mailto:r...@redhat.com wrote: No argument there, but that does in no way negate the need for some performance robustness. The

Re: [tip:core/locking] x86/smp: Move waiting on contended ticket lock out of line

2013-03-01 Thread Davidlohr Bueso
On Fri, 2013-03-01 at 01:42 -0500, Rik van Riel wrote: On 02/28/2013 06:09 PM, Linus Torvalds wrote: So I almost think that *everything* there in the semaphore code could be done under RCU. The actual spinlock doesn't seem to much matter, at least for semaphores. The semaphore values

[RFC PATCH 0/2] ipc: do not hold ipc lock more than necessary

2013-03-01 Thread Davidlohr Bueso
The following set of not-thoroughly-tested patches are based on the discussion of holding the ipc lock unnecessarily, such as for permissions and security checks: https://lkml.org/lkml/2013/2/28/540 Patch 0/1: Introduces new functions, analogous to ipc_lock and ipc_lock_check in the ipc utility

[RFC PATCH 1/2] ipc: introduce obtaining a lockless ipc object

2013-03-01 Thread Davidlohr Bueso
and return the ipc object. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- ipc/util.c | 42 -- ipc/util.h | 2 ++ 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/ipc/util.c b/ipc/util.c index 464a8ab..902f282 100644 --- a/ipc/util.c

[PATCH 2/2] ipc: semaphores: do not hold ipc lock more than necessary

2013-03-01 Thread Davidlohr Bueso
Instead of holding the ipc lock for permissions and security checks, among others, only acquire it when necessary. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- ipc/sem.c | 94 --- 1 file changed, 66 insertions(+), 28

[PATCH] lib/int_sqrt: optimize square root algorithm

2013-02-20 Thread Davidlohr Bueso
From: Davidlohr Bueso davidlohr.bu...@hp.com This patch optimizes the current version of the shift-and-subtract (hardware) algorithm, described by John von Newmann[1] and Guy L. Steele. Iterating 1,000,000 times, perf shows for the current version: Performance counter stats for './sqrt-curr

[PATCH] kernel/sys: initialize return codes when declaring variables

2012-09-06 Thread Davidlohr Bueso
Trivially initialize return codes with default values when the variable is declared. Signed-off-by: Davidlohr Bueso d...@gnu.org --- kernel/sys.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 241507f..b3b2ef7 100644

[PATCH] lib: gcd: prevent possible div by 0

2012-09-09 Thread Davidlohr Bueso
Account for properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Cc: sta...@vger.kernel.org Signed-off-by: Davidlohr Bueso d...@gnu.org --- lib/gcd.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gcd.c b/lib/gcd.c index cce4f3c..7e163c6 100644 --- a/lib

Re: [PATCH] lib: gcd: prevent possible div by 0

2012-09-10 Thread Davidlohr Bueso
On Mon, 2012-09-10 at 11:12 +0200, Eric Dumazet wrote: On Sun, 2012-09-09 at 17:03 +0200, Davidlohr Bueso wrote: Account for properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Cc: sta...@vger.kernel.org Signed-off-by: Davidlohr Bueso d...@gnu.org

[PATCH v2] lib: gcd: prevent possible div by 0

2012-09-10 Thread Davidlohr Bueso
Account for all properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Cc: sta...@vger.kernel.org Signed-off-by: Davidlohr Bueso d...@gnu.org --- V2: simplified checking with b = 0 (Eric) lib/gcd.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gcd.c b/lib

Re: [PATCH v2] lib: gcd: prevent possible div by 0

2012-09-12 Thread Davidlohr Bueso
ping? Cc'ing Greg for stable. On Mon, 2012-09-10 at 16:35 +0200, Davidlohr Bueso wrote: Account for all properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Cc: sta...@vger.kernel.org Signed-off-by: Davidlohr Bueso d...@gnu.org --- V2: simplified checking with b

Re: [PATCH v2] lib: gcd: prevent possible div by 0

2012-09-12 Thread Davidlohr Bueso
On Wed, 2012-09-12 at 12:10 -0700, Andrew Morton wrote: On Mon, 10 Sep 2012 16:35:19 +0200 Davidlohr Bueso d...@gnu.org wrote: Account for all properties when a and/or b are 0: gcd(0, 0) = 0 gcd(a, 0) = a gcd(0, b) = b Cc: sta...@vger.kernel.org Why cc:stable? If this patch

Re: [PATCH v2] lib: gcd: prevent possible div by 0

2012-09-12 Thread Davidlohr Bueso
On Wed, 2012-09-12 at 12:36 -0700, Andrew Morton wrote: On Wed, 12 Sep 2012 21:20:30 +0200 Davidlohr Bueso d...@gnu.org wrote: On Wed, 2012-09-12 at 12:10 -0700, Andrew Morton wrote: On Mon, 10 Sep 2012 16:35:19 +0200 Davidlohr Bueso d...@gnu.org wrote: Account for all

[PATCH] staging: keucr: remove String func prototypes

2012-09-12 Thread Davidlohr Bueso
Commit 1b9f644dfeb638e0146ce54f4e48c87a2841a603 already got rid of StringCopy and StringCmp, so remove the left over prototypes. Signed-off-by: Davidlohr Bueso d...@gnu.org --- drivers/staging/keucr/smcommon.h |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/keucr

[PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-08-31 Thread Davidlohr Bueso
For processors that support VPIDs we should invalidate the page table entry specified by the lineal address. For this purpose add support for individual address invalidations. Signed-off-by: Davidlohr Bueso d...@gnu.org --- arch/x86/include/asm/vmx.h |6 -- arch/x86/kvm/vmx.c

Re: [PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-09-02 Thread Davidlohr Bueso
On Fri, 2012-08-31 at 14:37 -0300, Marcelo Tosatti wrote: On Fri, Aug 31, 2012 at 06:10:48PM +0200, Davidlohr Bueso wrote: For processors that support VPIDs we should invalidate the page table entry specified by the lineal address. For this purpose add support for individual address

[PATCH 0/5] acpi: remove some legacy procfs interfaces

2012-09-02 Thread Davidlohr Bueso
Hi, This patchset is a first attempt to remove some of the deprecated procfs ACPI interfaces - in the final overall idea to remove /proc/acpi entirely. Based on the feature removal file, the CONFIG_ACPI_PROCFS_POWER and CONFIG_ACPI_PROC_EVENT options are dropped. patch 1: removes

[PATCH 5/5] acpi: events: remove procfs interface

2012-09-02 Thread Davidlohr Bueso
The /proc/acpi/event interface has been replaced by events through the input layer and netlink, and scheduled for removal over four years ago. Signed-off-by: Davidlohr Bueso d...@gnu.org --- Documentation/feature-removal-schedule.txt |8 -- drivers/acpi/Kconfig | 18

[PATCH 1/5] acpi: remove CONFIG_ACPI_PROCFS_POWER option

2012-09-02 Thread Davidlohr Bueso
The long time deprecated procfs interface for ACPI power devices has been scheduled for removal since linux 2.6.39. Signed-off-by: Davidlohr Bueso d...@gnu.org --- Documentation/feature-removal-schedule.txt | 11 - drivers/acpi/Kconfig | 17 -- drivers/acpi/Makefile

[PATCH 2/5] sonypi: remove acpi_bus_generate_proc_event

2012-09-02 Thread Davidlohr Bueso
Calling this function no longer makes sense as /proc/acpi/event is being removed. Signed-off-by: Davidlohr Bueso d...@gnu.org --- drivers/char/sonypi.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index f877805

[PATCH 3/5] PCI: hotplug: remove acpi_bus_generate_proc_event

2012-09-02 Thread Davidlohr Bueso
Calling this function no longer makes sense as /proc/acpi/event is being removed. Signed-off-by: Davidlohr Bueso d...@gnu.org --- drivers/pci/hotplug/acpiphp_ibm.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug

[PATCH 4/5] platform: x86: remove acpi_bus_generate_proc_event

2012-09-02 Thread Davidlohr Bueso
Calling this function no longer makes sense as /proc/acpi/event is being removed. Signed-off-by: Davidlohr Bueso d...@gnu.org --- drivers/platform/x86/asus-laptop.c |1 - drivers/platform/x86/eeepc-laptop.c |1 - drivers/platform/x86/fujitsu-laptop.c |4 drivers

[PATCH 1/3] partitions: efi: compare first and last usable LBAs

2012-09-05 Thread Davidlohr Bueso
When verifying GPT header integrity, make sure that first usable LBA is smaller than last usable LBA. Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/block/partitions/efi.c b/block/partitions

[PATCH 2/3] partitions: efi: verify header is outside usable area

2012-09-05 Thread Davidlohr Bueso
The first usable logical block can be used by a GUID partition entry, and therefore cannot be used by the header. Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/block/partitions/efi.c b/block

[PATCH 3/3] partitions: efi: check minimum header size

2012-09-05 Thread Davidlohr Bueso
As per UEFI specs 2.3.1 (June 2012), The Header Size must be greater than 92 and must be less than or equal to the logical block size Signed-off-by: Davidlohr Bueso d...@gnu.org --- block/partitions/efi.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/block

Re: [PATCH] KVM: VMX: invalidate vpid for invlpg instruction

2012-09-05 Thread Davidlohr Bueso
On Mon, 2012-09-03 at 12:11 +0300, Avi Kivity wrote: On 09/03/2012 02:27 AM, Davidlohr Bueso wrote: On Fri, 2012-08-31 at 14:37 -0300, Marcelo Tosatti wrote: On Fri, Aug 31, 2012 at 06:10:48PM +0200, Davidlohr Bueso wrote: For processors that support VPIDs we should invalidate the page

[PATCH] oom: remove deprecated oom_adj

2012-08-24 Thread Davidlohr Bueso
The deprecated /proc/pid/oom_adj is scheduled for removal this month. Signed-off-by: Davidlohr Bueso d...@gnu.org --- Documentation/ABI/obsolete/proc-pid-oom_adj | 22 - Documentation/feature-removal-schedule.txt | 25 -- Documentation/filesystems/proc.txt | 22 + fs

[PATCH] mm: add node physical memory range to sysfs

2012-12-07 Thread Davidlohr Bueso
This patch adds a new 'memrange' file that shows the starting and ending physical addresses that are associated to a node. This is useful for identifying specific DIMMs within the system. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/base/node.c | 15 +++ 1 file

[PATCH] Documentation: ABI: /sys/devices/system/node/

2012-12-10 Thread Davidlohr Bueso
Describe NUMA node sysfs files/attributes. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- Note that for the specific dates and contacts I couldn't find, I left it as default for Oct 2002 and linux-mm. Documentation/ABI/stable/sysfs-devices-node | 96 - 1

[PATCH] Documentation: ABI: remove testing/sysfs-devices-node

2012-12-20 Thread Davidlohr Bueso
This file is already documented in the stable ABI (commit 5bbe1ec1). Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- Documentation/ABI/testing/sysfs-devices-node | 7 --- 1 file changed, 7 deletions(-) delete mode 100644 Documentation/ABI/testing/sysfs-devices-node diff --git

[PATCH 1/3] staging: zram: simplify num_devices paramater

2013-01-01 Thread Davidlohr Bueso
Simplify dealing with num_devices when initializing zram. Also cleanup some of the output messages. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zram/zram_drv.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/zram

[PATCH 2/3] staging: zram: show correct disksize

2013-01-01 Thread Davidlohr Bueso
The -disksize variable stores values in units of bytes, print the correct size in Kb Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zram/zram_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging

[PATCH 3/3] staging: zram: drop zram_stat_dec/inc functions

2013-01-01 Thread Davidlohr Bueso
It seems like an overkill to have adding and subtracting 1 functions from the 32bit counters. Just do it directly. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zram/zram_drv.c | 26 -- 1 file changed, 8 insertions(+), 18 deletions(-) diff

[PATCH] staging: zsmalloc: comment zs_create_pool function

2013-01-04 Thread Davidlohr Bueso
Just as with zs_malloc() and zs_map_object(), it is worth formally commenting the zs_create_pool() function. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zsmalloc/zsmalloc-main.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/staging

Re: [PATCH] mm: add node physical memory range to sysfs

2012-12-12 Thread Davidlohr Bueso
On Fri, 2012-12-07 at 16:17 -0800, Dave Hansen wrote: On 12/07/2012 03:51 PM, Andrew Morton wrote: +static ssize_t node_read_memrange(struct device *dev, + struct device_attribute *attr, char *buf) +{ +int nid = dev-id; +unsigned

Re: [PATCH] mm: add node physical memory range to sysfs

2012-12-12 Thread Davidlohr Bueso
On Wed, 2012-12-12 at 17:48 -0800, Dave Hansen wrote: On 12/12/2012 05:18 PM, Davidlohr Bueso wrote: On Fri, 2012-12-07 at 16:17 -0800, Dave Hansen wrote: Seems like the better way to do this would be to expose the DIMMs themselves in some way, and then map _those_ back to a node. Good

Re: [PATCH] mm: add node physical memory range to sysfs

2012-12-13 Thread Davidlohr Bueso
On Wed, 2012-12-12 at 20:49 -0800, Dave Hansen wrote: On 12/12/2012 06:03 PM, Davidlohr Bueso wrote: On Wed, 2012-12-12 at 17:48 -0800, Dave Hansen wrote: But if we went and did it per-DIMM (showing which physical addresses and NUMA nodes a DIMM maps to), wouldn't that be redundant

[PATCH RESEND] PM/Hibernate: use rb_entry

2012-10-01 Thread Davidlohr Bueso
Since the software suspend extents are organized in an rbtree, use rb_entry instead of container_of, as it is semantically more appropriate in order to get a node as it is iterated. Signed-off-by: Davidlohr Bueso d...@gnu.org --- kernel/power/swap.c |2 +- 1 file changed, 1 insertion(+), 1

srat: harsh hot-pluggable memory check?

2013-01-10 Thread Davidlohr Bueso
When parsing the memory affinity mappings in arch/x86/mm/srat.c: acpi_numa_memory_affinity_init() I'm wondering if the hot-pluggable check is too harsh, as we consider an error if the hot-pluggable bit is set and CONFIG_MEMORY_HOTPLUG is not. Based on the ACPI specs (v5): If the Enabled bit

Re: srat: harsh hot-pluggable memory check?

2013-01-11 Thread Davidlohr Bueso
On Thu, 2013-01-10 at 21:02 +0100, Andi Kleen wrote: This only mentions that the system supports hot-plugging, and IMHO if the user decides not to use CONFIG_MEMORY_HOTPLUG, it shouldn't be considered an error. Therefore would it be ok to drop the check? Or am I missing something? The

[PATCH] ACPI: SRAT: report non-volatile memory in debug

2013-01-08 Thread Davidlohr Bueso
Just as with the other memory affinity flags, report non-volatile memory with ACPI debug. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/acpi/numa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index cb31298

[PATCH] x86: srat: simplify memory affinity init error handling

2013-01-08 Thread Davidlohr Bueso
The acpi_numa_memory_affinity_init() function can fail in several scenarios, use a single point of error return. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- arch/x86/mm/srat.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/arch

Re: [PATCH] ACPI: SRAT: report non-volatile memory in debug

2013-01-08 Thread Davidlohr Bueso
On Wed, 2013-01-09 at 01:34 +0100, Rafael J. Wysocki wrote: On Tuesday, January 08, 2013 04:15:56 PM Davidlohr Bueso wrote: Just as with the other memory affinity flags, report non-volatile memory with ACPI debug. Looks kind of good, but - Signed-off-by: Davidlohr Bueso davidlohr.bu

Re: [PATCH] staging: zsmalloc: comment zs_create_pool function

2013-01-09 Thread Davidlohr Bueso
ping? On Fri, 2013-01-04 at 12:14 -0800, Davidlohr Bueso wrote: Just as with zs_malloc() and zs_map_object(), it is worth formally commenting the zs_create_pool() function. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/staging/zsmalloc/zsmalloc-main.c | 11

[PATCH v2] ACPI: SRAT: report non-volatile memory in debug

2013-01-09 Thread Davidlohr Bueso
Just as with the other memory affinity flags, report non-volatile memory with ACPI debug. Signed-off-by: Davidlohr Bueso davidlohr.bu...@hp.com --- drivers/acpi/numa.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index

[PATCH 6/8] partitions/efi: compare first and last usable LBAs

2013-08-05 Thread Davidlohr Bueso
When verifying GPT header integrity, make sure that first usable LBA is smaller than last usable LBA. Signed-off-by: Davidlohr Bueso davidl...@hp.com --- block/partitions/efi.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/block/partitions/efi.c b/block/partitions

[PATCH 5/8] partitions/efi: account for pmbr size in lba

2013-08-05 Thread Davidlohr Bueso
The partition that has the 0xEE (GPT protective), must have the size in lba field set to the lesser of the size of the disk minus one or 0x for larger disks. Signed-off-by: Davidlohr Bueso davidl...@hp.com --- block/partitions/efi.c | 21 ++--- 1 file changed, 18

[PATCH 2/8] partitions/efi: check pmbr record's starting lba

2013-08-05 Thread Davidlohr Bueso
Per the UEFI Specs 2.4, June 2013, the starting lba of the partition that has the EFI GPT (0xEE) must be set to 0x0001 - this is obviously the LBA of the GPT Partition Header. Signed-off-by: Davidlohr Bueso davidl...@hp.com --- block/partitions/efi.c | 15 --- 1 file changed, 12

  1   2   3   4   5   6   7   8   9   10   >