2013-03-15 16:51:13

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 0/9 for-3.10] srcu: use-site fix and cleanups

All are simple cleanups(and one fix).

Patch1: fix imbalance srcu_read_[un]lock()
Patch2~6: use DEFINE[_STATIC]_SRCU macro
Patch7: use call_srcu() and remove a lot of code

Patch8~9: non-srcu related cleanup for fsnotify


Lai Jiangshan (9):
powerpc,kvm: fix imbalance srcu_read_[un]lock()
events: use DEFINE_STATIC_SRCU() to define pmus_srcu
mmu_notifier: use DEFINE_STATIC_SRCU() to define srcu struct
netpoll: use DEFINE_STATIC_SRCU() to define netpoll_srcu
tomoyo: use DEFINE_SRCU() to define tomoyo_ss
fsnotify: use DEFINE_SRCU() for srcu_struct
fsnotify: use existed call_srcu()
fsnotify: use BUILD_BUG_ON() to test ALL_FSNOTIFY_EVENTS
fsnotify: remove fsnotify_init()

arch/powerpc/kvm/book3s_hv.c | 2 +-
fs/notify/fsnotify.c | 14 ---------
fs/notify/mark.c | 61 +++++++-------------------------------
fs/notify/notification.c | 2 +
include/linux/fsnotify_backend.h | 2 +-
kernel/events/core.c | 3 +-
mm/mmu_notifier.c | 8 +----
net/core/netpoll.c | 3 +-
security/tomoyo/tomoyo.c | 5 +--
9 files changed, 20 insertions(+), 80 deletions(-)

--
1.7.4.4


2013-03-15 16:51:23

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

At the point of up_out label in kvmppc_hv_setup_htab_rma(),
srcu read lock is still held.

We have to release it before return.

Signed-off-by: Lai Jiangshan <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Cc: Gleb Natapov <[email protected]>
Cc: Alexander Graf <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
arch/powerpc/kvm/book3s_hv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 80dcc53..c26740e 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1799,7 +1799,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)

up_out:
up_read(&current->mm->mmap_sem);
- goto out;
+ goto out_srcu;
}

int kvmppc_core_init_vm(struct kvm *kvm)
--
1.7.4.4

2013-03-15 16:51:33

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 2/9] events: use DEFINE_STATIC_SRCU() to define pmus_srcu

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <[email protected]>
---
kernel/events/core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index b0cd865..c334f26 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -146,7 +146,7 @@ static atomic_t nr_task_events __read_mostly;

static LIST_HEAD(pmus);
static DEFINE_MUTEX(pmus_lock);
-static struct srcu_struct pmus_srcu;
+DEFINE_STATIC_SRCU(pmus_srcu);

/*
* perf event paranoia level:
@@ -7396,7 +7396,6 @@ void __init perf_event_init(void)
idr_init(&pmu_idr);

perf_event_init_all_cpus();
- init_srcu_struct(&pmus_srcu);
perf_pmu_register(&perf_swevent, "software", PERF_TYPE_SOFTWARE);
perf_pmu_register(&perf_cpu_clock, NULL, -1);
perf_pmu_register(&perf_task_clock, NULL, -1);
--
1.7.4.4

2013-03-15 16:51:47

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 3/9] mmu_notifier: use DEFINE_STATIC_SRCU() to define srcu struct

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.
also remove unneeded mmu_notifier_init().

Signed-off-by: Lai Jiangshan <[email protected]>
---
mm/mmu_notifier.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
index be04122..aa7c785 100644
--- a/mm/mmu_notifier.c
+++ b/mm/mmu_notifier.c
@@ -20,7 +20,7 @@
#include <linux/slab.h>

/* global SRCU for all MMs */
-static struct srcu_struct srcu;
+DEFINE_STATIC_SRCU(srcu);

/*
* This function can't run concurrently against mmu_notifier_register
@@ -326,9 +326,3 @@ void mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm)
}
EXPORT_SYMBOL_GPL(mmu_notifier_unregister);

-static int __init mmu_notifier_init(void)
-{
- return init_srcu_struct(&srcu);
-}
-
-module_init(mmu_notifier_init);
--
1.7.4.4

2013-03-15 16:52:00

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 4/9] netpoll: use DEFINE_STATIC_SRCU() to define netpoll_srcu

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <[email protected]>
---
net/core/netpoll.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index fa32899..a3a17ae 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -47,7 +47,7 @@ static struct sk_buff_head skb_pool;

static atomic_t trapped;

-static struct srcu_struct netpoll_srcu;
+DEFINE_STATIC_SRCU(netpoll_srcu);

#define USEC_PER_POLL 50
#define NETPOLL_RX_ENABLED 1
@@ -1212,7 +1212,6 @@ EXPORT_SYMBOL(netpoll_setup);
static int __init netpoll_init(void)
{
skb_queue_head_init(&skb_pool);
- init_srcu_struct(&netpoll_srcu);
return 0;
}
core_initcall(netpoll_init);
--
1.7.4.4

2013-03-15 16:52:22

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 5/9] tomoyo: use DEFINE_SRCU() to define tomoyo_ss

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <[email protected]>
---
security/tomoyo/tomoyo.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
index a2ee362..f0b756e 100644
--- a/security/tomoyo/tomoyo.c
+++ b/security/tomoyo/tomoyo.c
@@ -536,7 +536,7 @@ static struct security_operations tomoyo_security_ops = {
};

/* Lock for GC. */
-struct srcu_struct tomoyo_ss;
+DEFINE_SRCU(tomoyo_ss);

/**
* tomoyo_init - Register TOMOYO Linux as a LSM module.
@@ -550,8 +550,7 @@ static int __init tomoyo_init(void)
if (!security_module_enable(&tomoyo_security_ops))
return 0;
/* register ourselves with the security framework */
- if (register_security(&tomoyo_security_ops) ||
- init_srcu_struct(&tomoyo_ss))
+ if (register_security(&tomoyo_security_ops))
panic("Failure registering TOMOYO Linux");
printk(KERN_INFO "TOMOYO Linux initialized\n");
cred->security = &tomoyo_kernel_domain;
--
1.7.4.4

2013-03-15 16:52:39

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 6/9] fsnotify: use DEFINE_SRCU() for srcu_struct

DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.

Signed-off-by: Lai Jiangshan <[email protected]>
Cc: Eric Paris <[email protected]>
---
fs/notify/fsnotify.c | 6 ------
fs/notify/mark.c | 2 +-
2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 4bb21d6..aba962a 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -298,14 +298,8 @@ EXPORT_SYMBOL_GPL(fsnotify);

static __init int fsnotify_init(void)
{
- int ret;
-
BUG_ON(hweight32(ALL_FSNOTIFY_EVENTS) != 23);

- ret = init_srcu_struct(&fsnotify_mark_srcu);
- if (ret)
- panic("initializing fsnotify_mark_srcu");
-
return 0;
}
core_initcall(fsnotify_init);
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index fc6b49b..aeededc 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -97,7 +97,7 @@
#include <linux/fsnotify_backend.h>
#include "fsnotify.h"

-struct srcu_struct fsnotify_mark_srcu;
+DEFINE_SRCU(fsnotify_mark_srcu);
static DEFINE_SPINLOCK(destroy_lock);
static LIST_HEAD(destroy_list);
static DECLARE_WAIT_QUEUE_HEAD(destroy_waitq);
--
1.7.4.4

2013-03-15 16:52:47

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 7/9] fsnotify: use existed call_srcu()

fsnotify implements its own call_srcu() by:
dedicated thread + synchronize_srcu()

But srcu provides call_srcu() now, so we should convert them to use
existed call_srcu() and remove the thread.

Signed-off-by: Lai Jiangshan <[email protected]>
Cc: Eric Paris <[email protected]>
---
fs/notify/mark.c | 59 ++++++-------------------------------
include/linux/fsnotify_backend.h | 2 +-
2 files changed, 11 insertions(+), 50 deletions(-)

diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index aeededc..af5f0e1 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -98,9 +98,6 @@
#include "fsnotify.h"

DEFINE_SRCU(fsnotify_mark_srcu);
-static DEFINE_SPINLOCK(destroy_lock);
-static LIST_HEAD(destroy_list);
-static DECLARE_WAIT_QUEUE_HEAD(destroy_waitq);

void fsnotify_get_mark(struct fsnotify_mark *mark)
{
@@ -116,6 +113,14 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
}
}

+static void fsnotify_destroy_mark_rcu(struct rcu_head *rcu)
+{
+ struct fsnotify_mark *mark;
+
+ mark = container_of(rcu, struct fsnotify_mark, rcu);
+ fsnotify_put_mark(mark);
+}
+
/*
* Any time a mark is getting freed we end up here.
* The caller had better be holding a reference to this mark so we don't actually
@@ -155,10 +160,7 @@ void fsnotify_destroy_mark_locked(struct fsnotify_mark *mark,
/* release lock temporarily */
mutex_unlock(&group->mark_mutex);

- spin_lock(&destroy_lock);
- list_add(&mark->destroy_list, &destroy_list);
- spin_unlock(&destroy_lock);
- wake_up(&destroy_waitq);
+ call_srcu(&fsnotify_mark_srcu, &mark->rcu, fsnotify_destroy_mark_rcu);
/*
* We don't necessarily have a ref on mark from caller so the above destroy
* may have actually freed it, unless this group provides a 'freeing_mark'
@@ -273,11 +275,7 @@ err:
atomic_dec(&group->num_marks);

spin_unlock(&mark->lock);
-
- spin_lock(&destroy_lock);
- list_add(&mark->destroy_list, &destroy_list);
- spin_unlock(&destroy_lock);
- wake_up(&destroy_waitq);
+ call_srcu(&fsnotify_mark_srcu, &mark->rcu, fsnotify_destroy_mark_rcu);

return ret;
}
@@ -342,40 +340,3 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
atomic_set(&mark->refcnt, 1);
mark->free_mark = free_mark;
}
-
-static int fsnotify_mark_destroy(void *ignored)
-{
- struct fsnotify_mark *mark, *next;
- LIST_HEAD(private_destroy_list);
-
- for (;;) {
- spin_lock(&destroy_lock);
- /* exchange the list head */
- list_replace_init(&destroy_list, &private_destroy_list);
- spin_unlock(&destroy_lock);
-
- synchronize_srcu(&fsnotify_mark_srcu);
-
- list_for_each_entry_safe(mark, next, &private_destroy_list, destroy_list) {
- list_del_init(&mark->destroy_list);
- fsnotify_put_mark(mark);
- }
-
- wait_event_interruptible(destroy_waitq, !list_empty(&destroy_list));
- }
-
- return 0;
-}
-
-static int __init fsnotify_mark_init(void)
-{
- struct task_struct *thread;
-
- thread = kthread_run(fsnotify_mark_destroy, NULL,
- "fsnotify_mark");
- if (IS_ERR(thread))
- panic("unable to start fsnotify mark destruction thread.");
-
- return 0;
-}
-device_initcall(fsnotify_mark_init);
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index d5b0910..3d435eb 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -296,7 +296,7 @@ struct fsnotify_mark {
#define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08
#define FSNOTIFY_MARK_FLAG_ALIVE 0x10
unsigned int flags; /* vfsmount or inode mark? */
- struct list_head destroy_list;
+ struct rcu_head rcu;
void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */
};

--
1.7.4.4

2013-03-15 16:52:57

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 8/9] fsnotify: use BUILD_BUG_ON() to test the weight of ALL_FSNOTIFY_EVENTS

BUILD_BUG_ON() is build-time-test for constant. avoid runtime test.
also use HWEIGHT32() for build-time.

Signed-off-by: Lai Jiangshan <[email protected]>
Cc: Eric Paris <[email protected]>
---
fs/notify/fsnotify.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index aba962a..eaa0e9e 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -298,7 +298,7 @@ EXPORT_SYMBOL_GPL(fsnotify);

static __init int fsnotify_init(void)
{
- BUG_ON(hweight32(ALL_FSNOTIFY_EVENTS) != 23);
+ BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_EVENTS) != 23);

return 0;
}
--
1.7.4.4

2013-03-15 16:53:20

by Lai Jiangshan

[permalink] [raw]
Subject: [PATCH 9/9] fsnotify: remove fsnotify_init()

Since fsnotify_init() is empty in runtime, remove it.
The build time test is moved to notification.c

Signed-off-by: Lai Jiangshan <[email protected]>
Cc: Eric Paris <[email protected]>
---
fs/notify/fsnotify.c | 8 --------
fs/notify/notification.c | 2 ++
2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index eaa0e9e..2ea0c1a 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -295,11 +295,3 @@ out:
return ret;
}
EXPORT_SYMBOL_GPL(fsnotify);
-
-static __init int fsnotify_init(void)
-{
- BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_EVENTS) != 23);
-
- return 0;
-}
-core_initcall(fsnotify_init);
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index 7b51b05..80fc0b5 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -453,6 +453,8 @@ static __init int fsnotify_notification_init(void)
fsnotify_event_cachep = KMEM_CACHE(fsnotify_event, SLAB_PANIC);
fsnotify_event_holder_cachep = KMEM_CACHE(fsnotify_event_holder, SLAB_PANIC);

+ BUILD_BUG_ON(HWEIGHT32(ALL_FSNOTIFY_EVENTS) != 23);
+
q_overflow_event = fsnotify_create_event(NULL, FS_Q_OVERFLOW, NULL,
FSNOTIFY_EVENT_NONE, NULL, 0,
GFP_KERNEL);
--
1.7.4.4

2013-03-17 16:43:13

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 4/9] netpoll: use DEFINE_STATIC_SRCU() to define netpoll_srcu

From: Lai Jiangshan <[email protected]>
Date: Sat, 16 Mar 2013 00:50:52 +0800

> DEFINE_STATIC_SRCU() defines srcu struct and do init at build time.
>
> Signed-off-by: Lai Jiangshan <[email protected]>

Applied.

2013-03-17 21:26:58

by Paul Mackerras

[permalink] [raw]
Subject: Re: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

On Sat, Mar 16, 2013 at 12:50:49AM +0800, Lai Jiangshan wrote:
> At the point of up_out label in kvmppc_hv_setup_htab_rma(),
> srcu read lock is still held.
>
> We have to release it before return.
>
> Signed-off-by: Lai Jiangshan <[email protected]>
> Cc: Marcelo Tosatti <[email protected]>
> Cc: Gleb Natapov <[email protected]>
> Cc: Alexander Graf <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: Paul Mackerras <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> arch/powerpc/kvm/book3s_hv.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 80dcc53..c26740e 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -1799,7 +1799,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
>
> up_out:
> up_read(&current->mm->mmap_sem);
> - goto out;
> + goto out_srcu;

Acked-by: Paul Mackerras <[email protected]>

2013-04-05 07:31:34

by Lai Jiangshan

[permalink] [raw]
Subject: Re: [PATCH 7/9] fsnotify: use existed call_srcu()

[Ping]

Hi, Eric Paris

Could you review this patch?

Thanks,
Lai

On 03/16/2013 12:50 AM, Lai Jiangshan wrote:
> fsnotify implements its own call_srcu() by:
> dedicated thread + synchronize_srcu()
>
> But srcu provides call_srcu() now, so we should convert them to use
> existed call_srcu() and remove the thread.
>
> Signed-off-by: Lai Jiangshan <[email protected]>
> Cc: Eric Paris <[email protected]>
> ---
> fs/notify/mark.c | 59 ++++++-------------------------------
> include/linux/fsnotify_backend.h | 2 +-
> 2 files changed, 11 insertions(+), 50 deletions(-)
>
> diff --git a/fs/notify/mark.c b/fs/notify/mark.c
> index aeededc..af5f0e1 100644
> --- a/fs/notify/mark.c
> +++ b/fs/notify/mark.c
> @@ -98,9 +98,6 @@
> #include "fsnotify.h"
>
> DEFINE_SRCU(fsnotify_mark_srcu);
> -static DEFINE_SPINLOCK(destroy_lock);
> -static LIST_HEAD(destroy_list);
> -static DECLARE_WAIT_QUEUE_HEAD(destroy_waitq);
>
> void fsnotify_get_mark(struct fsnotify_mark *mark)
> {
> @@ -116,6 +113,14 @@ void fsnotify_put_mark(struct fsnotify_mark *mark)
> }
> }
>
> +static void fsnotify_destroy_mark_rcu(struct rcu_head *rcu)
> +{
> + struct fsnotify_mark *mark;
> +
> + mark = container_of(rcu, struct fsnotify_mark, rcu);
> + fsnotify_put_mark(mark);
> +}
> +
> /*
> * Any time a mark is getting freed we end up here.
> * The caller had better be holding a reference to this mark so we don't actually
> @@ -155,10 +160,7 @@ void fsnotify_destroy_mark_locked(struct fsnotify_mark *mark,
> /* release lock temporarily */
> mutex_unlock(&group->mark_mutex);
>
> - spin_lock(&destroy_lock);
> - list_add(&mark->destroy_list, &destroy_list);
> - spin_unlock(&destroy_lock);
> - wake_up(&destroy_waitq);
> + call_srcu(&fsnotify_mark_srcu, &mark->rcu, fsnotify_destroy_mark_rcu);
> /*
> * We don't necessarily have a ref on mark from caller so the above destroy
> * may have actually freed it, unless this group provides a 'freeing_mark'
> @@ -273,11 +275,7 @@ err:
> atomic_dec(&group->num_marks);
>
> spin_unlock(&mark->lock);
> -
> - spin_lock(&destroy_lock);
> - list_add(&mark->destroy_list, &destroy_list);
> - spin_unlock(&destroy_lock);
> - wake_up(&destroy_waitq);
> + call_srcu(&fsnotify_mark_srcu, &mark->rcu, fsnotify_destroy_mark_rcu);
>
> return ret;
> }
> @@ -342,40 +340,3 @@ void fsnotify_init_mark(struct fsnotify_mark *mark,
> atomic_set(&mark->refcnt, 1);
> mark->free_mark = free_mark;
> }
> -
> -static int fsnotify_mark_destroy(void *ignored)
> -{
> - struct fsnotify_mark *mark, *next;
> - LIST_HEAD(private_destroy_list);
> -
> - for (;;) {
> - spin_lock(&destroy_lock);
> - /* exchange the list head */
> - list_replace_init(&destroy_list, &private_destroy_list);
> - spin_unlock(&destroy_lock);
> -
> - synchronize_srcu(&fsnotify_mark_srcu);
> -
> - list_for_each_entry_safe(mark, next, &private_destroy_list, destroy_list) {
> - list_del_init(&mark->destroy_list);
> - fsnotify_put_mark(mark);
> - }
> -
> - wait_event_interruptible(destroy_waitq, !list_empty(&destroy_list));
> - }
> -
> - return 0;
> -}
> -
> -static int __init fsnotify_mark_init(void)
> -{
> - struct task_struct *thread;
> -
> - thread = kthread_run(fsnotify_mark_destroy, NULL,
> - "fsnotify_mark");
> - if (IS_ERR(thread))
> - panic("unable to start fsnotify mark destruction thread.");
> -
> - return 0;
> -}
> -device_initcall(fsnotify_mark_init);
> diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
> index d5b0910..3d435eb 100644
> --- a/include/linux/fsnotify_backend.h
> +++ b/include/linux/fsnotify_backend.h
> @@ -296,7 +296,7 @@ struct fsnotify_mark {
> #define FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY 0x08
> #define FSNOTIFY_MARK_FLAG_ALIVE 0x10
> unsigned int flags; /* vfsmount or inode mark? */
> - struct list_head destroy_list;
> + struct rcu_head rcu;
> void (*free_mark)(struct fsnotify_mark *mark); /* called on final put+free */
> };
>

2013-04-11 21:51:39

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

On Mon, Mar 18, 2013 at 08:26:48AM +1100, Paul Mackerras wrote:
> On Sat, Mar 16, 2013 at 12:50:49AM +0800, Lai Jiangshan wrote:
> > At the point of up_out label in kvmppc_hv_setup_htab_rma(),
> > srcu read lock is still held.
> >
> > We have to release it before return.
> >
> > Signed-off-by: Lai Jiangshan <[email protected]>
> > Cc: Marcelo Tosatti <[email protected]>
> > Cc: Gleb Natapov <[email protected]>
> > Cc: Alexander Graf <[email protected]>
> > Cc: Benjamin Herrenschmidt <[email protected]>
> > Cc: Paul Mackerras <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > ---
> > arch/powerpc/kvm/book3s_hv.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> > index 80dcc53..c26740e 100644
> > --- a/arch/powerpc/kvm/book3s_hv.c
> > +++ b/arch/powerpc/kvm/book3s_hv.c
> > @@ -1799,7 +1799,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
> >
> > up_out:
> > up_read(&current->mm->mmap_sem);
> > - goto out;
> > + goto out_srcu;
>
> Acked-by: Paul Mackerras <[email protected]>

Thank you both, queued for 3.11 (assuming no one has beat me to it).

Thanx, Paul