public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held
@ 2010-05-30 20:28 Julia Lawall
  2010-05-31  8:38 ` Christian Borntraeger
  0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2010-05-30 20:28 UTC (permalink / raw)
  To: Carsten Otte, Christian Borntraeger, linux390, Avi Kivity,
	Marcelo Tosatti, Martin

From: Julia Lawall <julia@diku.dk>

The containing function is called from several places.  At one of them, in
the function __sigp_stop, the spin lock &fi->lock is held.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@gfp exists@
identifier fn;
position p;
@@

fn(...) {
... when != spin_unlock
    when any
  GFP_KERNEL@p
 ... when any
}

@locked@
identifier gfp.fn;
@@

spin_lock(...)
... when != spin_unlock
fn(...)

@depends on locked@
position gfp.p;
@@

- GFP_KERNEL@p
+ GFP_ATOMIC
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/s390/kvm/sigp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -113,7 +113,7 @@ static int __inject_sigp_stop(struct kvm
 {
 	struct kvm_s390_interrupt_info *inti;
 
-	inti = kzalloc(sizeof(*inti), GFP_KERNEL);
+	inti = kzalloc(sizeof(*inti), GFP_ATOMIC);
 	if (!inti)
 		return -ENOMEM;
 	inti->type = KVM_S390_SIGP_STOP;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held
  2010-05-30 20:28 [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held Julia Lawall
@ 2010-05-31  8:38 ` Christian Borntraeger
  2010-05-31  8:56   ` Martin Schwidefsky
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Borntraeger @ 2010-05-31  8:38 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Carsten Otte, linux390, Avi Kivity, Marcelo Tosatti,
	Martin Schwidefsky, Heiko Carstens, linux-s390, kvm, linux-kernel,
	kernel-janitors

> The containing function is called from several places.  At one of them, in
> the function __sigp_stop, the spin lock &fi->lock is held.
[...]
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>

[...]
> --- a/arch/s390/kvm/sigp.c
> +++ b/arch/s390/kvm/sigp.c
> @@ -113,7 +113,7 @@ static int __inject_sigp_stop(struct kvm
>  {
>  	struct kvm_s390_interrupt_info *inti;
> 
> -	inti = kzalloc(sizeof(*inti), GFP_KERNEL);
> +	inti = kzalloc(sizeof(*inti), GFP_ATOMIC);
>  	if (!inti)
>  		return -ENOMEM;
>  	inti->type = KVM_S390_SIGP_STOP;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held
  2010-05-31  8:38 ` Christian Borntraeger
@ 2010-05-31  8:56   ` Martin Schwidefsky
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Schwidefsky @ 2010-05-31  8:56 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Julia Lawall, Carsten Otte, linux390, Avi Kivity, Marcelo Tosatti,
	Heiko Carstens, linux-s390, kvm, linux-kernel, kernel-janitors

On Mon, 31 May 2010 10:38:07 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> > The containing function is called from several places.  At one of them, in
> > the function __sigp_stop, the spin lock &fi->lock is held.
> [...]
> > Signed-off-by: Julia Lawall <julia@diku.dk>
> 
> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>

Ok, I'll add the patch to git390. Thanks.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-31  8:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-30 20:28 [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held Julia Lawall
2010-05-31  8:38 ` Christian Borntraeger
2010-05-31  8:56   ` Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox