linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] userfaultfdv4.2 update for -mm
@ 2015-05-26 15:34 Andrea Arcangeli
  2015-05-26 15:34 ` [PATCH] userfaultfd: cleanup superfluous _irq locking Andrea Arcangeli
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Arcangeli @ 2015-05-26 15:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm

Oops there was a leftover _irq, now I also checked there's no other
irq leftover, the word "irq" disappeared from the file.

The patch applies at the end but ideally should be moved earlier
(anywhere before the patch that activates the syscall).

Thanks,
Andrea

Andrea Arcangeli (1):
  userfaultfd: cleanup superfluous _irq locking

 fs/userfaultfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [PATCH] userfaultfd: cleanup superfluous _irq locking
  2015-05-26 15:34 [PATCH] userfaultfdv4.2 update for -mm Andrea Arcangeli
@ 2015-05-26 15:34 ` Andrea Arcangeli
  0 siblings, 0 replies; 2+ messages in thread
From: Andrea Arcangeli @ 2015-05-26 15:34 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm

This leftover shouldn't have caused any malfunction because the loop
either schedules or it re-enables irqs immediately and schedule()
doesn't seem to BUG_ON(irqs_disabled()). However lately we've been
using the non blocking model so the schedule isn't really exercised
here. Regardless of the side effects this must be fixed as it's not ok
to enter schedule with irq disabled and it's not beneficial to toggle
irqs in the first place.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
 fs/userfaultfd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index a519f74..5f11678 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -558,11 +558,11 @@ static ssize_t userfaultfd_ctx_read(struct userfaultfd_ctx *ctx, int no_wait,
 		}
 		spin_unlock(&ctx->fd_wqh.lock);
 		schedule();
-		spin_lock_irq(&ctx->fd_wqh.lock);
+		spin_lock(&ctx->fd_wqh.lock);
 	}
 	__remove_wait_queue(&ctx->fd_wqh, &wait);
 	__set_current_state(TASK_RUNNING);
-	spin_unlock_irq(&ctx->fd_wqh.lock);
+	spin_unlock(&ctx->fd_wqh.lock);
 
 	return ret;
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2015-05-26 15:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-26 15:34 [PATCH] userfaultfdv4.2 update for -mm Andrea Arcangeli
2015-05-26 15:34 ` [PATCH] userfaultfd: cleanup superfluous _irq locking Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).