public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
@ 2013-06-21 19:34 Sedat Dilek
  2013-06-21 22:07 ` Davidlohr Bueso
       [not found] ` <CA+icZUVbUD1tUa_ORtn_ZZebpp3gXXHGAcNe0NdYPXPMPoABuA@mail.gmail.com>
  0 siblings, 2 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-06-21 19:34 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

[-- Attachment #1: Type: text/plain, Size: 2842 bytes --]

On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> Happy solstice!
>
> Changes since 20130620:
>
> Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
>
> The net-next tree gained a conflict against the net tree.
>
> The leds tree still had its build failure, so I used the version from
> next-20130607.
>
> The arm-soc tree gained conflicts against the tip, net-next, mfd and
> mailbox trees.
>
> The staging tree still had its build failure for which I disabled some
> code.
>
> The akpm tree lost a few patches that turned up elsewhere and gained
> conflicts against the ftrace and arm-soc trees.
>
> ----------------------------------------------------------------------------
>

[ CC IPC folks ]

Building via 'make deb-pkg' with fakeroot fails here like this:

make: *** [deb-pkg] Terminated
/usr/bin/fakeroot: line 181:  2386 Terminated
FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
"$@"
semop(1): encountered an error: Identifier removed
semop(2): encountered an error: Invalid argument
semop(1): encountered an error: Identifier removed
semop(1): encountered an error: Identifier removed
semop(1): encountered an error: Invalid argument
semop(1): encountered an error: Invalid argument
semop(1): encountered an error: Invalid argument

The issue is present since next-20130606!

LAST KNOWN GOOD: next-20130605
FIRST KNOWN BAD: next-20130606

KNOWN GOOD: next-20130604
KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621

git-bisect says CULPRIT commit is...

     "ipc,msg: shorten critical region in msgrcv"

NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!

Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.

I have tested the revert-patches with next-20130606 and next-20130621
(see file-attachments).

My build-script is attached!

Can someone of the IPC folks look at that?
Thanks!

- Sedat -


P.S.: Commit-IDs listed below.

[ next-20130606 ]

http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606

"ipc: remove unused functions"
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79

"ipc,msg: shorten critical region in msgrcv"
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed

[ next-20130621 ]

http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621

"ipc: remove unused functions"
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3

"ipc,msg: shorten critical region in msgrcv"
http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac

[-- Attachment #2: build_linux-next.sh --]
[-- Type: application/x-sh, Size: 3849 bytes --]

[-- Attachment #3: 3.10.0-rc4-next20130606-3-iniza-small.patch --]
[-- Type: application/octet-stream, Size: 6338 bytes --]

Sedat Dilek (7):
      kbuild: deb-pkg: Try to determine distribution
      kbuild: deb-pkg: Bump year in debian/copyright file
      kbuild: deb-pkg: Update git repository URL in debian/copyright file
      Merge tag 'next-20130606' of git://git.kernel.org/.../next/linux-next into Linux-Next-v20130606
      Merge branch 'deb-pkg-3.10-fixes' into 3.10.0-rc4-next20130606-1-iniza-small
      Revert "ipc,msg: shorten critical region in msgrcv"
      Merge branch 'revert-ipc-msg-next20130606-c0ff93322847' into 3.10.0-rc4-next20130606-3-iniza-small

 ipc/msg.c                | 57 +++++++++++++++++++++---------------------------
 scripts/package/builddeb | 19 +++++++++++++---
 2 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index 3b7b4b5..75ec881 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -862,19 +862,21 @@ static struct msg_msg *find_msg(struct msg_queue *msq, long *msgtyp, int mode)
 	return ERR_PTR(-EAGAIN);
 }
 
-long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgflg,
+
+long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
+	       int msgflg,
 	       long (*msg_handler)(void __user *, struct msg_msg *, size_t))
 {
-	int mode;
 	struct msg_queue *msq;
+	struct msg_msg *msg;
+	int mode;
 	struct ipc_namespace *ns;
-	struct msg_msg *msg, *copy = NULL;
+	struct msg_msg *copy = NULL;
 
 	ns = current->nsproxy->ipc_ns;
 
 	if (msqid < 0 || (long) bufsz < 0)
 		return -EINVAL;
-
 	if (msgflg & MSG_COPY) {
 		copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax));
 		if (IS_ERR(copy))
@@ -882,10 +884,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 	}
 	mode = convert_mode(&msgtyp, msgflg);
 
-	rcu_read_lock();
-	msq = msq_obtain_object_check(ns, msqid);
+	msq = msg_lock_check(ns, msqid);
 	if (IS_ERR(msq)) {
-		rcu_read_unlock();
 		free_copy(copy);
 		return PTR_ERR(msq);
 	}
@@ -895,9 +895,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 
 		msg = ERR_PTR(-EACCES);
 		if (ipcperms(ns, &msq->q_perm, S_IRUGO))
-			goto out_unlock1;
+			goto out_unlock;
 
 		msg = find_msg(msq, &msgtyp, mode);
+
 		if (!IS_ERR(msg)) {
 			/*
 			 * Found a suitable message.
@@ -905,7 +906,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
 				msg = ERR_PTR(-E2BIG);
-				goto out_unlock1;
+				goto out_unlock;
 			}
 			/*
 			 * If we are copying, then do not unlink message and do
@@ -913,10 +914,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if (msgflg & MSG_COPY) {
 				msg = copy_msg(msg, copy);
-				goto out_unlock1;
+				goto out_unlock;
 			}
-
-			ipc_lock_object(&msq->q_perm);
 			list_del(&msg->m_list);
 			msq->q_qnum--;
 			msq->q_rtime = get_seconds();
@@ -925,17 +924,14 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			atomic_sub(msg->m_ts, &ns->msg_bytes);
 			atomic_dec(&ns->msg_hdrs);
 			ss_wakeup(&msq->q_senders, 0);
-
-			goto out_unlock0;
+			msg_unlock(msq);
+			break;
 		}
-
 		/* No message waiting. Wait for a message */
 		if (msgflg & IPC_NOWAIT) {
 			msg = ERR_PTR(-ENOMSG);
-			goto out_unlock1;
+			goto out_unlock;
 		}
-
-		ipc_lock_object(&msq->q_perm);
 		list_add_tail(&msr_d.r_list, &msq->q_receivers);
 		msr_d.r_tsk = current;
 		msr_d.r_msgtype = msgtyp;
@@ -946,9 +942,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			msr_d.r_maxsize = bufsz;
 		msr_d.r_msg = ERR_PTR(-EAGAIN);
 		current->state = TASK_INTERRUPTIBLE;
+		msg_unlock(msq);
 
-		ipc_unlock_object(&msq->q_perm);
-		rcu_read_unlock();
 		schedule();
 
 		/* Lockless receive, part 1:
@@ -978,34 +973,32 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 		 * If there is a message or an error then accept it without
 		 * locking.
 		 */
-		if (msg != ERR_PTR(-EAGAIN))
-			goto out_unlock1;
+		if (msg != ERR_PTR(-EAGAIN)) {
+			rcu_read_unlock();
+			break;
+		}
 
 		/* Lockless receive, part 3:
 		 * Acquire the queue spinlock.
 		 */
-		ipc_lock_object(&msq->q_perm);
+		ipc_lock_by_ptr(&msq->q_perm);
+		rcu_read_unlock();
 
 		/* Lockless receive, part 4:
 		 * Repeat test after acquiring the spinlock.
 		 */
 		msg = (struct msg_msg*)msr_d.r_msg;
 		if (msg != ERR_PTR(-EAGAIN))
-			goto out_unlock0;
+			goto out_unlock;
 
 		list_del(&msr_d.r_list);
 		if (signal_pending(current)) {
 			msg = ERR_PTR(-ERESTARTNOHAND);
-			goto out_unlock0;
+out_unlock:
+			msg_unlock(msq);
+			break;
 		}
-
-		ipc_unlock_object(&msq->q_perm);
 	}
-
-out_unlock0:
-	ipc_unlock_object(&msq->q_perm);
-out_unlock1:
-	rcu_read_unlock();
 	if (IS_ERR(msg)) {
 		free_copy(copy);
 		return PTR_ERR(msg);
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..7d7c9d8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -172,9 +172,22 @@ else
 fi
 maintainer="$name <$email>"
 
+# Try to determine distribution
+if [ -e $(which lsb_release) ]; then
+       codename=$(lsb_release --codename --short)
+       if [ "$codename" != "" ]; then
+		distribution=$codename
+       else
+		distribution="UNRELEASED"
+		echo "WARNING: The distribution could NOT be determined!"
+       fi
+else
+       echo "HINT: Install lsb_release binary, this helps to identify your distribution!"
+fi
+
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
-linux-upstream ($packageversion) unstable; urgency=low
+linux-upstream ($packageversion) $distribution; urgency=low
 
   * Custom built Linux kernel.
 
@@ -188,10 +201,10 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991 - 2013 Linus Torvalds and others.
 
 The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by

[-- Attachment #4: 3.10.0-rc6-next20130621-2-iniza-small.patch --]
[-- Type: application/octet-stream, Size: 7638 bytes --]

Sedat Dilek (8):
      kbuild: deb-pkg: Try to determine distribution
      kbuild: deb-pkg: Bump year in debian/copyright file
      kbuild: deb-pkg: Update git repository URL in debian/copyright file
      Merge tag 'next-20130621' of git://git.kernel.org/.../next/linux-next into Linux-Next-v20130621
      Merge branch 'deb-pkg-3.10-fixes' into 3.10.0-rc6-next20130621-1-iniza-small
      Revert "ipc: remove unused functions"
      Revert "ipc,msg: shorten critical region in msgrcv"
      Merge branch 'revert-ipc-next20130621-941ce57c81dc-62190df4081e' into 3.10.0-rc6-next20130621-2-iniza-small

 ipc/msg.c                | 82 +++++++++++++++++++++++++++++-------------------
 ipc/sem.c                |  1 +
 scripts/package/builddeb | 19 +++++++++--
 3 files changed, 67 insertions(+), 35 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index a1cf70e..f2a1a8f 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -141,6 +141,31 @@ void __init msg_init(void)
 				IPC_MSG_IDS, sysvipc_msg_proc_show);
 }
 
+/*
+ * msg_lock_(check_) routines are called in the paths where the rw_mutex
+ * is not held.
+ */
+static inline struct msg_queue *msg_lock(struct ipc_namespace *ns, int id)
+{
+	struct kern_ipc_perm *ipcp = ipc_lock(&msg_ids(ns), id);
+
+	if (IS_ERR(ipcp))
+		return (struct msg_queue *)ipcp;
+
+	return container_of(ipcp, struct msg_queue, q_perm);
+}
+
+static inline struct msg_queue *msg_lock_check(struct ipc_namespace *ns,
+						int id)
+{
+	struct kern_ipc_perm *ipcp = ipc_lock_check(&msg_ids(ns), id);
+
+	if (IS_ERR(ipcp))
+		return (struct msg_queue *)ipcp;
+
+	return container_of(ipcp, struct msg_queue, q_perm);
+}
+
 static inline struct msg_queue *msq_obtain_object(struct ipc_namespace *ns, int id)
 {
 	struct kern_ipc_perm *ipcp = ipc_obtain_object(&msg_ids(ns), id);
@@ -860,19 +885,21 @@ static struct msg_msg *find_msg(struct msg_queue *msq, long *msgtyp, int mode)
 	return ERR_PTR(-EAGAIN);
 }
 
-long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgflg,
+
+long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
+	       int msgflg,
 	       long (*msg_handler)(void __user *, struct msg_msg *, size_t))
 {
-	int mode;
 	struct msg_queue *msq;
+	struct msg_msg *msg;
+	int mode;
 	struct ipc_namespace *ns;
-	struct msg_msg *msg, *copy = NULL;
+	struct msg_msg *copy = NULL;
 
 	ns = current->nsproxy->ipc_ns;
 
 	if (msqid < 0 || (long) bufsz < 0)
 		return -EINVAL;
-
 	if (msgflg & MSG_COPY) {
 		copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax));
 		if (IS_ERR(copy))
@@ -880,10 +907,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 	}
 	mode = convert_mode(&msgtyp, msgflg);
 
-	rcu_read_lock();
-	msq = msq_obtain_object_check(ns, msqid);
+	msq = msg_lock_check(ns, msqid);
 	if (IS_ERR(msq)) {
-		rcu_read_unlock();
 		free_copy(copy);
 		return PTR_ERR(msq);
 	}
@@ -893,9 +918,10 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 
 		msg = ERR_PTR(-EACCES);
 		if (ipcperms(ns, &msq->q_perm, S_IRUGO))
-			goto out_unlock1;
+			goto out_unlock;
 
 		msg = find_msg(msq, &msgtyp, mode);
+
 		if (!IS_ERR(msg)) {
 			/*
 			 * Found a suitable message.
@@ -903,7 +929,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
 				msg = ERR_PTR(-E2BIG);
-				goto out_unlock1;
+				goto out_unlock;
 			}
 			/*
 			 * If we are copying, then do not unlink message and do
@@ -911,10 +937,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if (msgflg & MSG_COPY) {
 				msg = copy_msg(msg, copy);
-				goto out_unlock1;
+				goto out_unlock;
 			}
-
-			ipc_lock_object(&msq->q_perm);
 			list_del(&msg->m_list);
 			msq->q_qnum--;
 			msq->q_rtime = get_seconds();
@@ -923,17 +947,14 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			atomic_sub(msg->m_ts, &ns->msg_bytes);
 			atomic_dec(&ns->msg_hdrs);
 			ss_wakeup(&msq->q_senders, 0);
-
-			goto out_unlock0;
+			msg_unlock(msq);
+			break;
 		}
-
 		/* No message waiting. Wait for a message */
 		if (msgflg & IPC_NOWAIT) {
 			msg = ERR_PTR(-ENOMSG);
-			goto out_unlock1;
+			goto out_unlock;
 		}
-
-		ipc_lock_object(&msq->q_perm);
 		list_add_tail(&msr_d.r_list, &msq->q_receivers);
 		msr_d.r_tsk = current;
 		msr_d.r_msgtype = msgtyp;
@@ -944,9 +965,8 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			msr_d.r_maxsize = bufsz;
 		msr_d.r_msg = ERR_PTR(-EAGAIN);
 		current->state = TASK_INTERRUPTIBLE;
+		msg_unlock(msq);
 
-		ipc_unlock_object(&msq->q_perm);
-		rcu_read_unlock();
 		schedule();
 
 		/* Lockless receive, part 1:
@@ -976,34 +996,32 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 		 * If there is a message or an error then accept it without
 		 * locking.
 		 */
-		if (msg != ERR_PTR(-EAGAIN))
-			goto out_unlock1;
+		if (msg != ERR_PTR(-EAGAIN)) {
+			rcu_read_unlock();
+			break;
+		}
 
 		/* Lockless receive, part 3:
 		 * Acquire the queue spinlock.
 		 */
-		ipc_lock_object(&msq->q_perm);
+		ipc_lock_by_ptr(&msq->q_perm);
+		rcu_read_unlock();
 
 		/* Lockless receive, part 4:
 		 * Repeat test after acquiring the spinlock.
 		 */
 		msg = (struct msg_msg*)msr_d.r_msg;
 		if (msg != ERR_PTR(-EAGAIN))
-			goto out_unlock0;
+			goto out_unlock;
 
 		list_del(&msr_d.r_list);
 		if (signal_pending(current)) {
 			msg = ERR_PTR(-ERESTARTNOHAND);
-			goto out_unlock0;
+out_unlock:
+			msg_unlock(msq);
+			break;
 		}
-
-		ipc_unlock_object(&msq->q_perm);
 	}
-
-out_unlock0:
-	ipc_unlock_object(&msq->q_perm);
-out_unlock1:
-	rcu_read_unlock();
 	if (IS_ERR(msg)) {
 		free_copy(copy);
 		return PTR_ERR(msg);
diff --git a/ipc/sem.c b/ipc/sem.c
index 4108889..b93f9c9 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -1455,6 +1455,7 @@ static int semctl_down(struct ipc_namespace *ns, int semid,
 				      &semid64.sem_perm, 0);
 	if (IS_ERR(ipcp)) {
 		err = PTR_ERR(ipcp);
+		/* the ipc lock is not held upon failure */
 		goto out_unlock1;
 	}
 
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index acb8650..7d7c9d8 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -172,9 +172,22 @@ else
 fi
 maintainer="$name <$email>"
 
+# Try to determine distribution
+if [ -e $(which lsb_release) ]; then
+       codename=$(lsb_release --codename --short)
+       if [ "$codename" != "" ]; then
+		distribution=$codename
+       else
+		distribution="UNRELEASED"
+		echo "WARNING: The distribution could NOT be determined!"
+       fi
+else
+       echo "HINT: Install lsb_release binary, this helps to identify your distribution!"
+fi
+
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
-linux-upstream ($packageversion) unstable; urgency=low
+linux-upstream ($packageversion) $distribution; urgency=low
 
   * Custom built Linux kernel.
 
@@ -188,10 +201,10 @@ This is a packacked upstream version of the Linux kernel.
 The sources may be found at most Linux ftp sites, including:
 ftp://ftp.kernel.org/pub/linux/kernel
 
-Copyright: 1991 - 2009 Linus Torvalds and others.
+Copyright: 1991 - 2013 Linus Torvalds and others.
 
 The git repository for mainline kernel development is at:
-git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by

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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
  2013-06-21 19:34 linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ] Sedat Dilek
@ 2013-06-21 22:07 ` Davidlohr Bueso
  2013-06-21 22:54   ` Sedat Dilek
       [not found] ` <CA+icZUVbUD1tUa_ORtn_ZZebpp3gXXHGAcNe0NdYPXPMPoABuA@mail.gmail.com>
  1 sibling, 1 reply; 30+ messages in thread
From: Davidlohr Bueso @ 2013-06-21 22:07 UTC (permalink / raw)
  To: sedat.dilek
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

On Fri, 2013-06-21 at 21:34 +0200, Sedat Dilek wrote:
> On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi all,
> >
> > Happy solstice!
> >
> > Changes since 20130620:
> >
> > Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
> >
> > The net-next tree gained a conflict against the net tree.
> >
> > The leds tree still had its build failure, so I used the version from
> > next-20130607.
> >
> > The arm-soc tree gained conflicts against the tip, net-next, mfd and
> > mailbox trees.
> >
> > The staging tree still had its build failure for which I disabled some
> > code.
> >
> > The akpm tree lost a few patches that turned up elsewhere and gained
> > conflicts against the ftrace and arm-soc trees.
> >
> > ----------------------------------------------------------------------------
> >
> 
> [ CC IPC folks ]
> 
> Building via 'make deb-pkg' with fakeroot fails here like this:
> 
> make: *** [deb-pkg] Terminated
> /usr/bin/fakeroot: line 181:  2386 Terminated
> FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
> "$@"
> semop(1): encountered an error: Identifier removed
> semop(2): encountered an error: Invalid argument
> semop(1): encountered an error: Identifier removed
> semop(1): encountered an error: Identifier removed
> semop(1): encountered an error: Invalid argument
> semop(1): encountered an error: Invalid argument
> semop(1): encountered an error: Invalid argument
> 

Hmmm those really shouldn't be related to the message queue changes. Are
you sure you got the right bisect? 

Manfred has a few ipc/sem.c patches in linux-next, starting at commit
c50df1b4 (ipc/sem.c: cacheline align the semaphore structures), does
reverting any of those instead of "ipc,msg: shorten critical region in
msgrcv" help at all? Also, anything reported in dmesg?

> The issue is present since next-20130606!
> 
> LAST KNOWN GOOD: next-20130605
> FIRST KNOWN BAD: next-20130606
> 
> KNOWN GOOD: next-20130604
> KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621
> 
> git-bisect says CULPRIT commit is...
> 
>      "ipc,msg: shorten critical region in msgrcv"

This I get. I went through the code again and it looks correct and
functionally equivalent to the old msgrcv.

> 
> NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!

This I don't get. Restoring msg_lock_[check] is already equivalent to
reverting "ipc,msg: shorten critical region in msgrcv" and several other
of the msq patches. What other patch needs reverted?

Anyway, I'll see if I can reproduce the issue, maybe I'm missing
something.

Thanks,
Davidlohr

> 
> Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.
> 
> I have tested the revert-patches with next-20130606 and next-20130621
> (see file-attachments).
> 
> My build-script is attached!
> 
> Can someone of the IPC folks look at that?
> Thanks!
> 
> - Sedat -
> 
> 
> P.S.: Commit-IDs listed below.
> 
> [ next-20130606 ]
> 
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606
> 
> "ipc: remove unused functions"
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79
> 
> "ipc,msg: shorten critical region in msgrcv"
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed
> 
> [ next-20130621 ]
> 
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621
> 
> "ipc: remove unused functions"
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3
> 
> "ipc,msg: shorten critical region in msgrcv"
> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac



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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
  2013-06-21 22:07 ` Davidlohr Bueso
@ 2013-06-21 22:54   ` Sedat Dilek
  2013-06-21 23:11     ` Davidlohr Bueso
  2013-06-21 23:15     ` Sedat Dilek
  0 siblings, 2 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-06-21 22:54 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

On Sat, Jun 22, 2013 at 12:07 AM, Davidlohr Bueso
<davidlohr.bueso@hp.com> wrote:
> On Fri, 2013-06-21 at 21:34 +0200, Sedat Dilek wrote:
>> On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>> > Hi all,
>> >
>> > Happy solstice!
>> >
>> > Changes since 20130620:
>> >
>> > Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
>> >
>> > The net-next tree gained a conflict against the net tree.
>> >
>> > The leds tree still had its build failure, so I used the version from
>> > next-20130607.
>> >
>> > The arm-soc tree gained conflicts against the tip, net-next, mfd and
>> > mailbox trees.
>> >
>> > The staging tree still had its build failure for which I disabled some
>> > code.
>> >
>> > The akpm tree lost a few patches that turned up elsewhere and gained
>> > conflicts against the ftrace and arm-soc trees.
>> >
>> > ----------------------------------------------------------------------------
>> >
>>
>> [ CC IPC folks ]
>>
>> Building via 'make deb-pkg' with fakeroot fails here like this:
>>
>> make: *** [deb-pkg] Terminated
>> /usr/bin/fakeroot: line 181:  2386 Terminated
>> FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
>> "$@"
>> semop(1): encountered an error: Identifier removed
>> semop(2): encountered an error: Invalid argument
>> semop(1): encountered an error: Identifier removed
>> semop(1): encountered an error: Identifier removed
>> semop(1): encountered an error: Invalid argument
>> semop(1): encountered an error: Invalid argument
>> semop(1): encountered an error: Invalid argument
>>
>
> Hmmm those really shouldn't be related to the message queue changes. Are
> you sure you got the right bisect?
>
> Manfred has a few ipc/sem.c patches in linux-next, starting at commit
> c50df1b4 (ipc/sem.c: cacheline align the semaphore structures), does
> reverting any of those instead of "ipc,msg: shorten critical region in
> msgrcv" help at all? Also, anything reported in dmesg?
>

First, I reverted all IPC patches from akpm-tree within -next.
Then, I isolated the culprit by git-bisecting.
As I checked my logs I did not see anything helpful.

>> The issue is present since next-20130606!
>>
>> LAST KNOWN GOOD: next-20130605
>> FIRST KNOWN BAD: next-20130606
>>
>> KNOWN GOOD: next-20130604
>> KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621
>>
>> git-bisect says CULPRIT commit is...
>>
>>      "ipc,msg: shorten critical region in msgrcv"
>
> This I get. I went through the code again and it looks correct and
> functionally equivalent to the old msgrcv.
>

Hmm, I guess a rcu_read_unlock() is missing?

[ next-20130605 ]
...
		/* Lockless receive, part 3:
		 * Acquire the queue spinlock.
		 */
		ipc_lock_by_ptr(&msq->q_perm);
		rcu_read_unlock();
...
[ next-20130621 ]
...
		/* Lockless receive, part 3:
		 * Acquire the queue spinlock.
		 */
		ipc_lock_object(&msq->q_perm);
...

Whereas ipc_lock_by_ptr() is equivalent to:
rcu_read_lock();
ipc_lock_object();

>>
>> NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!
>
> This I don't get. Restoring msg_lock_[check] is already equivalent to
> reverting "ipc,msg: shorten critical region in msgrcv" and several other
> of the msq patches. What other patch needs reverted?
>

No, you have to revert both patches as the other removed
msg_lock_[check] afterwards.

> Anyway, I'll see if I can reproduce the issue, maybe I'm missing
> something.
>

Yupp, I try with adding rcu_read_unlock()... and report.

- Sedat -

> Thanks,
> Davidlohr
>
>>
>> Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.
>>
>> I have tested the revert-patches with next-20130606 and next-20130621
>> (see file-attachments).
>>
>> My build-script is attached!
>>
>> Can someone of the IPC folks look at that?
>> Thanks!
>>
>> - Sedat -
>>
>>
>> P.S.: Commit-IDs listed below.
>>
>> [ next-20130606 ]
>>
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606
>>
>> "ipc: remove unused functions"
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79
>>
>> "ipc,msg: shorten critical region in msgrcv"
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed
>>
>> [ next-20130621 ]
>>
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621
>>
>> "ipc: remove unused functions"
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3
>>
>> "ipc,msg: shorten critical region in msgrcv"
>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac
>
>

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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
  2013-06-21 22:54   ` Sedat Dilek
@ 2013-06-21 23:11     ` Davidlohr Bueso
  2013-06-21 23:14       ` Sedat Dilek
  2013-06-21 23:15     ` Sedat Dilek
  1 sibling, 1 reply; 30+ messages in thread
From: Davidlohr Bueso @ 2013-06-21 23:11 UTC (permalink / raw)
  To: sedat.dilek
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

On Sat, 2013-06-22 at 00:54 +0200, Sedat Dilek wrote:
> On Sat, Jun 22, 2013 at 12:07 AM, Davidlohr Bueso
> <davidlohr.bueso@hp.com> wrote:
> > On Fri, 2013-06-21 at 21:34 +0200, Sedat Dilek wrote:
> >> On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >> > Hi all,
> >> >
> >> > Happy solstice!
> >> >
> >> > Changes since 20130620:
> >> >
> >> > Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
> >> >
> >> > The net-next tree gained a conflict against the net tree.
> >> >
> >> > The leds tree still had its build failure, so I used the version from
> >> > next-20130607.
> >> >
> >> > The arm-soc tree gained conflicts against the tip, net-next, mfd and
> >> > mailbox trees.
> >> >
> >> > The staging tree still had its build failure for which I disabled some
> >> > code.
> >> >
> >> > The akpm tree lost a few patches that turned up elsewhere and gained
> >> > conflicts against the ftrace and arm-soc trees.
> >> >
> >> > ----------------------------------------------------------------------------
> >> >
> >>
> >> [ CC IPC folks ]
> >>
> >> Building via 'make deb-pkg' with fakeroot fails here like this:
> >>
> >> make: *** [deb-pkg] Terminated
> >> /usr/bin/fakeroot: line 181:  2386 Terminated
> >> FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
> >> "$@"
> >> semop(1): encountered an error: Identifier removed
> >> semop(2): encountered an error: Invalid argument
> >> semop(1): encountered an error: Identifier removed
> >> semop(1): encountered an error: Identifier removed
> >> semop(1): encountered an error: Invalid argument
> >> semop(1): encountered an error: Invalid argument
> >> semop(1): encountered an error: Invalid argument
> >>
> >
> > Hmmm those really shouldn't be related to the message queue changes. Are
> > you sure you got the right bisect?
> >
> > Manfred has a few ipc/sem.c patches in linux-next, starting at commit
> > c50df1b4 (ipc/sem.c: cacheline align the semaphore structures), does
> > reverting any of those instead of "ipc,msg: shorten critical region in
> > msgrcv" help at all? Also, anything reported in dmesg?
> >
> 
> First, I reverted all IPC patches from akpm-tree within -next.
> Then, I isolated the culprit by git-bisecting.
> As I checked my logs I did not see anything helpful.
> 
> >> The issue is present since next-20130606!
> >>
> >> LAST KNOWN GOOD: next-20130605
> >> FIRST KNOWN BAD: next-20130606
> >>
> >> KNOWN GOOD: next-20130604
> >> KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621
> >>
> >> git-bisect says CULPRIT commit is...
> >>
> >>      "ipc,msg: shorten critical region in msgrcv"
> >
> > This I get. I went through the code again and it looks correct and
> > functionally equivalent to the old msgrcv.
> >
> 
> Hmm, I guess a rcu_read_unlock() is missing?
> 
> [ next-20130605 ]
> ...
> 		/* Lockless receive, part 3:
> 		 * Acquire the queue spinlock.
> 		 */
> 		ipc_lock_by_ptr(&msq->q_perm);
> 		rcu_read_unlock();
> ...
> [ next-20130621 ]
> ...
> 		/* Lockless receive, part 3:
> 		 * Acquire the queue spinlock.
> 		 */
> 		ipc_lock_object(&msq->q_perm);
> ...
> 
> Whereas ipc_lock_by_ptr() is equivalent to:
> rcu_read_lock();
> ipc_lock_object();

Yeah, I noticed that, but it's not an error. In the older code we have

rcu_read_lock (Lockless receive, part 1)
[...]
/* Lockless receive, part 3:
 * Acquire the queue spinlock.
 */
ipc_lock_by_ptr(&msq->q_perm);
rcu_read_unlock();


Which translates to:
rcu_read_lock (Lockless receive, part 1)
[...]
/* Lockless receive, part 3:
 * Acquire the queue spinlock.
 */
rcu_read_lock();
ipc_lock_object();
rcu_read_unlock();

And thus, after that last rcu_read_unlock we are left with
rcu_read_lock()
ipc_lock_object();

If you notice, that's exactly what is done in the new code, only much
more readable: We do rcu_read_lock in the part 1, then in part 3, we
acquire the spinlock via ipc_lock_object(&msq->q_perm)


> >>
> >> NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!
> >
> > This I don't get. Restoring msg_lock_[check] is already equivalent to
> > reverting "ipc,msg: shorten critical region in msgrcv" and several other
> > of the msq patches. What other patch needs reverted?
> >
> 
> No, you have to revert both patches as the other removed
> msg_lock_[check] afterwards.
> 
> > Anyway, I'll see if I can reproduce the issue, maybe I'm missing
> > something.
> >
> 
> Yupp, I try with adding rcu_read_unlock()... and report.
> 
> - Sedat -
> 
> > Thanks,
> > Davidlohr
> >
> >>
> >> Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.
> >>
> >> I have tested the revert-patches with next-20130606 and next-20130621
> >> (see file-attachments).
> >>
> >> My build-script is attached!
> >>
> >> Can someone of the IPC folks look at that?
> >> Thanks!
> >>
> >> - Sedat -
> >>
> >>
> >> P.S.: Commit-IDs listed below.
> >>
> >> [ next-20130606 ]
> >>
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606
> >>
> >> "ipc: remove unused functions"
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79
> >>
> >> "ipc,msg: shorten critical region in msgrcv"
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed
> >>
> >> [ next-20130621 ]
> >>
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621
> >>
> >> "ipc: remove unused functions"
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3
> >>
> >> "ipc,msg: shorten critical region in msgrcv"
> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac
> >
> >



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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
  2013-06-21 23:11     ` Davidlohr Bueso
@ 2013-06-21 23:14       ` Sedat Dilek
  0 siblings, 0 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-06-21 23:14 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

On Sat, Jun 22, 2013 at 1:11 AM, Davidlohr Bueso <davidlohr.bueso@hp.com> wrote:
> On Sat, 2013-06-22 at 00:54 +0200, Sedat Dilek wrote:
>> On Sat, Jun 22, 2013 at 12:07 AM, Davidlohr Bueso
>> <davidlohr.bueso@hp.com> wrote:
>> > On Fri, 2013-06-21 at 21:34 +0200, Sedat Dilek wrote:
>> >> On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>> >> > Hi all,
>> >> >
>> >> > Happy solstice!
>> >> >
>> >> > Changes since 20130620:
>> >> >
>> >> > Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
>> >> >
>> >> > The net-next tree gained a conflict against the net tree.
>> >> >
>> >> > The leds tree still had its build failure, so I used the version from
>> >> > next-20130607.
>> >> >
>> >> > The arm-soc tree gained conflicts against the tip, net-next, mfd and
>> >> > mailbox trees.
>> >> >
>> >> > The staging tree still had its build failure for which I disabled some
>> >> > code.
>> >> >
>> >> > The akpm tree lost a few patches that turned up elsewhere and gained
>> >> > conflicts against the ftrace and arm-soc trees.
>> >> >
>> >> > ----------------------------------------------------------------------------
>> >> >
>> >>
>> >> [ CC IPC folks ]
>> >>
>> >> Building via 'make deb-pkg' with fakeroot fails here like this:
>> >>
>> >> make: *** [deb-pkg] Terminated
>> >> /usr/bin/fakeroot: line 181:  2386 Terminated
>> >> FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
>> >> "$@"
>> >> semop(1): encountered an error: Identifier removed
>> >> semop(2): encountered an error: Invalid argument
>> >> semop(1): encountered an error: Identifier removed
>> >> semop(1): encountered an error: Identifier removed
>> >> semop(1): encountered an error: Invalid argument
>> >> semop(1): encountered an error: Invalid argument
>> >> semop(1): encountered an error: Invalid argument
>> >>
>> >
>> > Hmmm those really shouldn't be related to the message queue changes. Are
>> > you sure you got the right bisect?
>> >
>> > Manfred has a few ipc/sem.c patches in linux-next, starting at commit
>> > c50df1b4 (ipc/sem.c: cacheline align the semaphore structures), does
>> > reverting any of those instead of "ipc,msg: shorten critical region in
>> > msgrcv" help at all? Also, anything reported in dmesg?
>> >
>>
>> First, I reverted all IPC patches from akpm-tree within -next.
>> Then, I isolated the culprit by git-bisecting.
>> As I checked my logs I did not see anything helpful.
>>
>> >> The issue is present since next-20130606!
>> >>
>> >> LAST KNOWN GOOD: next-20130605
>> >> FIRST KNOWN BAD: next-20130606
>> >>
>> >> KNOWN GOOD: next-20130604
>> >> KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621
>> >>
>> >> git-bisect says CULPRIT commit is...
>> >>
>> >>      "ipc,msg: shorten critical region in msgrcv"
>> >
>> > This I get. I went through the code again and it looks correct and
>> > functionally equivalent to the old msgrcv.
>> >
>>
>> Hmm, I guess a rcu_read_unlock() is missing?
>>
>> [ next-20130605 ]
>> ...
>>               /* Lockless receive, part 3:
>>                * Acquire the queue spinlock.
>>                */
>>               ipc_lock_by_ptr(&msq->q_perm);
>>               rcu_read_unlock();
>> ...
>> [ next-20130621 ]
>> ...
>>               /* Lockless receive, part 3:
>>                * Acquire the queue spinlock.
>>                */
>>               ipc_lock_object(&msq->q_perm);
>> ...
>>
>> Whereas ipc_lock_by_ptr() is equivalent to:
>> rcu_read_lock();
>> ipc_lock_object();
>
> Yeah, I noticed that, but it's not an error. In the older code we have
>
> rcu_read_lock (Lockless receive, part 1)
> [...]
> /* Lockless receive, part 3:
>  * Acquire the queue spinlock.
>  */
> ipc_lock_by_ptr(&msq->q_perm);
> rcu_read_unlock();
>
>
> Which translates to:
> rcu_read_lock (Lockless receive, part 1)
> [...]
> /* Lockless receive, part 3:
>  * Acquire the queue spinlock.
>  */
> rcu_read_lock();
> ipc_lock_object();
> rcu_read_unlock();
>
> And thus, after that last rcu_read_unlock we are left with
> rcu_read_lock()
> ipc_lock_object();
>
> If you notice, that's exactly what is done in the new code, only much
> more readable: We do rcu_read_lock in the part 1, then in part 3, we
> acquire the spinlock via ipc_lock_object(&msq->q_perm)
>

OK.

AFAICS some comments has to be refreshed.

		/* Lockless receive, part 1:
		 * Disable preemption.  We don't hold a reference to the queue
		 * and getting a reference would defeat the idea of a lockless
		 * operation, thus the code relies on rcu to guarantee the
		 * existence of msq:
		 * Prior to destruction, expunge_all(-EIRDM) changes r_msg.
		 * Thus if r_msg is -EAGAIN, then the queue not yet destroyed.
		 * rcu_read_lock() prevents preemption between reading r_msg
		 * and the spin_lock() inside ipc_lock_by_ptr().

...as there is no usage of ipc_lock_by_ptr().

NO success with that:

--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -983,6 +983,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t
bufsz, long msgtyp, int msgfl
                 * Acquire the queue spinlock.
                 */
                ipc_lock_object(&msq->q_perm);
+               rcu_read_unlock();

                /* Lockless receive, part 4:
                 * Repeat test after acquiring the spinlock.

- Sedat -

>
>> >>
>> >> NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!
>> >
>> > This I don't get. Restoring msg_lock_[check] is already equivalent to
>> > reverting "ipc,msg: shorten critical region in msgrcv" and several other
>> > of the msq patches. What other patch needs reverted?
>> >
>>
>> No, you have to revert both patches as the other removed
>> msg_lock_[check] afterwards.
>>
>> > Anyway, I'll see if I can reproduce the issue, maybe I'm missing
>> > something.
>> >
>>
>> Yupp, I try with adding rcu_read_unlock()... and report.
>>
>> - Sedat -
>>
>> > Thanks,
>> > Davidlohr
>> >
>> >>
>> >> Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.
>> >>
>> >> I have tested the revert-patches with next-20130606 and next-20130621
>> >> (see file-attachments).
>> >>
>> >> My build-script is attached!
>> >>
>> >> Can someone of the IPC folks look at that?
>> >> Thanks!
>> >>
>> >> - Sedat -
>> >>
>> >>
>> >> P.S.: Commit-IDs listed below.
>> >>
>> >> [ next-20130606 ]
>> >>
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606
>> >>
>> >> "ipc: remove unused functions"
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79
>> >>
>> >> "ipc,msg: shorten critical region in msgrcv"
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed
>> >>
>> >> [ next-20130621 ]
>> >>
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621
>> >>
>> >> "ipc: remove unused functions"
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3
>> >>
>> >> "ipc,msg: shorten critical region in msgrcv"
>> >> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac
>> >
>> >
>
>

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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
  2013-06-21 22:54   ` Sedat Dilek
  2013-06-21 23:11     ` Davidlohr Bueso
@ 2013-06-21 23:15     ` Sedat Dilek
  1 sibling, 0 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-06-21 23:15 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul

On Sat, Jun 22, 2013 at 12:54 AM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Sat, Jun 22, 2013 at 12:07 AM, Davidlohr Bueso
> <davidlohr.bueso@hp.com> wrote:
>> On Fri, 2013-06-21 at 21:34 +0200, Sedat Dilek wrote:
>>> On Fri, Jun 21, 2013 at 10:17 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> > Hi all,
>>> >
>>> > Happy solstice!
>>> >
>>> > Changes since 20130620:
>>> >
>>> > Dropped tree: mailbox (really bad merge conflicts with the arm-soc tree)
>>> >
>>> > The net-next tree gained a conflict against the net tree.
>>> >
>>> > The leds tree still had its build failure, so I used the version from
>>> > next-20130607.
>>> >
>>> > The arm-soc tree gained conflicts against the tip, net-next, mfd and
>>> > mailbox trees.
>>> >
>>> > The staging tree still had its build failure for which I disabled some
>>> > code.
>>> >
>>> > The akpm tree lost a few patches that turned up elsewhere and gained
>>> > conflicts against the ftrace and arm-soc trees.
>>> >
>>> > ----------------------------------------------------------------------------
>>> >
>>>
>>> [ CC IPC folks ]
>>>
>>> Building via 'make deb-pkg' with fakeroot fails here like this:
>>>
>>> make: *** [deb-pkg] Terminated
>>> /usr/bin/fakeroot: line 181:  2386 Terminated
>>> FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
>>> "$@"
>>> semop(1): encountered an error: Identifier removed
>>> semop(2): encountered an error: Invalid argument
>>> semop(1): encountered an error: Identifier removed
>>> semop(1): encountered an error: Identifier removed
>>> semop(1): encountered an error: Invalid argument
>>> semop(1): encountered an error: Invalid argument
>>> semop(1): encountered an error: Invalid argument
>>>
>>
>> Hmmm those really shouldn't be related to the message queue changes. Are
>> you sure you got the right bisect?
>>
>> Manfred has a few ipc/sem.c patches in linux-next, starting at commit
>> c50df1b4 (ipc/sem.c: cacheline align the semaphore structures), does
>> reverting any of those instead of "ipc,msg: shorten critical region in
>> msgrcv" help at all? Also, anything reported in dmesg?
>>
>
> First, I reverted all IPC patches from akpm-tree within -next.
> Then, I isolated the culprit by git-bisecting.
> As I checked my logs I did not see anything helpful.
>
>>> The issue is present since next-20130606!
>>>
>>> LAST KNOWN GOOD: next-20130605
>>> FIRST KNOWN BAD: next-20130606
>>>
>>> KNOWN GOOD: next-20130604
>>> KNOWN BAD:  next-20130607 || next-20130619 || next-20130620 || next-20130621
>>>
>>> git-bisect says CULPRIT commit is...
>>>
>>>      "ipc,msg: shorten critical region in msgrcv"
>>
>> This I get. I went through the code again and it looks correct and
>> functionally equivalent to the old msgrcv.
>>
>
> Hmm, I guess a rcu_read_unlock() is missing?
>
> [ next-20130605 ]
> ...
>                 /* Lockless receive, part 3:
>                  * Acquire the queue spinlock.
>                  */
>                 ipc_lock_by_ptr(&msq->q_perm);
>                 rcu_read_unlock();
> ...
> [ next-20130621 ]
> ...
>                 /* Lockless receive, part 3:
>                  * Acquire the queue spinlock.
>                  */
>                 ipc_lock_object(&msq->q_perm);
> ...
>
> Whereas ipc_lock_by_ptr() is equivalent to:
> rcu_read_lock();
> ipc_lock_object();
>
>>>
>>> NOTE: msg_lock_(check_) routines have to be restored (one more revert needed)!
>>
>> This I don't get. Restoring msg_lock_[check] is already equivalent to
>> reverting "ipc,msg: shorten critical region in msgrcv" and several other
>> of the msq patches. What other patch needs reverted?
>>
>
> No, you have to revert both patches as the other removed
> msg_lock_[check] afterwards.
>
>> Anyway, I'll see if I can reproduce the issue, maybe I'm missing
>> something.
>>
>
> Yupp, I try with adding rcu_read_unlock()... and report.
>
> - Sedat -
>
>> Thanks,
>> Davidlohr
>>
>>>
>>> Reverting both (below) commits makes fakeroot build via 'make dep-pkg" again.
>>>
>>> I have tested the revert-patches with next-20130606 and next-20130621
>>> (see file-attachments).
>>>
>>> My build-script is attached!
>>>
>>> Can someone of the IPC folks look at that?
>>> Thanks!
>>>
>>> - Sedat -
>>>
>>>
>>> P.S.: Commit-IDs listed below.
>>>
>>> [ next-20130606 ]
>>>
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130606
>>>
>>> "ipc: remove unused functions"
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=8793fdfb0d0a6ed5916767e29a15d3eb56e04e79
>>>
>>> "ipc,msg: shorten critical region in msgrcv"
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c0ff93322847a54f74a5450032c4df64c17fdaed
>>>
>>> [ next-20130621 ]
>>>
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/?id=next-20130621
>>>
>>> "ipc: remove unused functions"
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=941ce57c81dcceadf55265616ee1e8bef18b0ad3
>>>
>>> "ipc,msg: shorten critical region in msgrcv"
>>> http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=62190df4081ee8504e3611d45edb40450cb408ac
>>
>>

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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
       [not found] ` <CA+icZUVbUD1tUa_ORtn_ZZebpp3gXXHGAcNe0NdYPXPMPoABuA@mail.gmail.com>
@ 2013-06-25 20:33   ` Davidlohr Bueso
       [not found]     ` <CA+icZUXgOd=URJBH5MGAZKdvdkMpFt+5mRxtzuDzq_vFHpoc2A@mail.gmail.com>
  0 siblings, 1 reply; 30+ messages in thread
From: Davidlohr Bueso @ 2013-06-25 20:33 UTC (permalink / raw)
  To: sedat.dilek
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
[...]

> I did some more testing with Linux-Testing-Project (release:
> ltp-full-20130503) and next-20130624 (Monday) which has still the
> issue, here.
> 
> If I revert the mentioned two commits from my local
> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
> is fine.
> 
> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
> 
>    root# ./runltp -f ipc
> 
>    root# ./runltp -f syscalls

These are nice test cases!

So I was able to reproduce the issue with LTP and manually running
msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
before calling it. The following changes fixes the issue and passes all
'runltp -f syscall' tests, could you give it a try?

Thanks,
Davidlohr

diff --git a/ipc/msg.c b/ipc/msg.c
index a1cf70e..a1f7d84 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -895,6 +895,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
                if (ipcperms(ns, &msq->q_perm, S_IRUGO))
                        goto out_unlock1;
 
+               ipc_lock_object(&msq->q_perm);
                msg = find_msg(msq, &msgtyp, mode);
                if (!IS_ERR(msg)) {
                        /*
@@ -903,7 +904,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
                         */
                        if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
                                msg = ERR_PTR(-E2BIG);
-                               goto out_unlock1;
+                               goto out_unlock0;
                        }
                        /*
                         * If we are copying, then do not unlink message and do
@@ -911,10 +912,9 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
                         */
                        if (msgflg & MSG_COPY) {
                                msg = copy_msg(msg, copy);
-                               goto out_unlock1;
+                               goto out_unlock0;
                        }
 
-                       ipc_lock_object(&msq->q_perm);
                        list_del(&msg->m_list);
                        msq->q_qnum--;
                        msq->q_rtime = get_seconds();
@@ -930,10 +930,9 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
                /* No message waiting. Wait for a message */
                if (msgflg & IPC_NOWAIT) {
                        msg = ERR_PTR(-ENOMSG);
-                       goto out_unlock1;
+                       goto out_unlock0;
                }
 
-               ipc_lock_object(&msq->q_perm);
                list_add_tail(&msr_d.r_list, &msq->q_receivers);
                msr_d.r_tsk = current;
                msr_d.r_msgtype = msgtyp;


Thanks,
Davidlohr
> 
> IPC seems to be fine for both -1 (UNPATCHED) and -2 (with attached two
> REVERTED patches) kernel, but -1 hangs in the SYSCALLS/msgctl08 test.
> 
> Previous msgctl07 is OK, but ***msgctl08*** produces this:
> ...
> <<<test_start>>>
> tag=msgctl07 stime=1372174934
> cmdline="msgctl07"
> contacts=""
> analysis=exit
> <<<test_output>>>
> msgctl07    1  TPASS  :  msgctl07 ran successfully!
> <<<execution_status>>>
> initiation_status="ok"
> duration=20 termination_type=exited termination_id=0 corefile=no
> cutime=1995 cstime=3
> <<<test_end>>>
> <<<test_start>>>
> tag=msgctl08 stime=1372174954
> cmdline="msgctl08"
> contacts=""
> analysis=exit
> <<<test_output>>>
> msgctl08    0  TWARN  :  Verify error in child 0, *buf = 28, val = 27, size = 8
> msgctl08    1  TFAIL  :  in child 0 read # = 73,key =  127
> msgctl08    0  TWARN  :  Verify error in child 3, *buf = ffffff8a, val
> = ffffff89, size = 52
> msgctl08    1  TFAIL  :  in child 3 read # = 157,key =  189
> msgctl08    0  TWARN  :  Verify error in child 2, *buf = ffffff87, val
> = ffffff86, size = 71
> msgctl08    1  TFAIL  :  in child 2 read # = 15954,key =  3e86
> msgctl08    0  TWARN  :  Verify error in child 12, *buf = ffffffa9,
> val = ffffffa8, size = 22
> msgctl08    1  TFAIL  :  in child 12 read # = 12904,key =  32a8
> msgctl08    0  TWARN  :  Verify error in child 13, *buf = 36, val =
> 35, size = 27
> msgctl08    1  TFAIL  :  in child 13 read # = 10442,key =  2935
> msgctl08    0  TWARN  :  Verify error in child 10, *buf = ffffff86,
> val = ffffff85, size = 63
> msgctl08    1  TFAIL  :  in child 10 read # = 19713,key =  4d85
> msgctl08    0  TWARN  :  Verify error in child 4, *buf = 4c, val = 4b, size = 83
> msgctl08    1  TFAIL  :  in child 4 read # = 23082,key =  5a4b
> msgctl08    0  TWARN  :  Verify error in child 15, *buf = 61, val =
> 60, size = 94
> msgctl08    1  TFAIL  :  in child 15 read # = 23554,key =  5c60
> msgctl08    0  TWARN  :  Verify error in child 11, *buf = 3b, val =
> 3a, size = 22
> msgctl08    1  TFAIL  :  in child 11 read # = 26468,key =  683a
> msgctl08    0  TWARN  :  Verify error in child 5, *buf = ffffffb5, val
> = ffffffb4, size = 41
> msgctl08    1  TFAIL  :  in child 5 read # = 31867,key =  7cb4
> msgctl08    0  TWARN  :  Verify error in child 1, *buf = 7d, val = 7c, size = 59
> msgctl08    1  TFAIL  :  in child 1 read # = 41063,key =  a07c
> msgctl08    0  TWARN  :  Verify error in child 7, *buf = fffffff2, val
> = fffffff1, size = 83
> msgctl08    1  TFAIL  :  in child 7 read # = 38476,key =  96f1
> msgctl08    0  TWARN  :  Verify error in child 9, *buf = ffffff8b, val
> = ffffff8a, size = 40
> msgctl08    1  TFAIL  :  in child 9 read # = 90438,key =  1618a
> msgctl08    0  TWARN  :  Verify error in child 8, *buf = ffffffcd, val
> = ffffffcc, size = 38
> msgctl08    1  TFAIL  :  in child 8 read # = 88712,key =  15acc
> msgctl08    0  TWARN  :  Verify error in child 6, *buf = 6, val = 5, size = 1
> msgctl08    1  TFAIL  :  in child 6 read # = 83297,key =  14605
> ***** STOPPED *****
> 
> See "ltp-full-20130503.git/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c" [1].
> 
> NOTE: Debian/Ubuntu users with dash as default shell require the patch from [2].
> 
> - Sedat -
> 
> P.S.: Unfortunately, fakeroot DEBUG doc file is outdated.
> 
> [1] https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
> [2] https://github.com/linux-test-project/ltp/commit/b88fa5b6ec5a29834a0e52df7b22b9bb47fe0379



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

* Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]
       [not found]     ` <CA+icZUXgOd=URJBH5MGAZKdvdkMpFt+5mRxtzuDzq_vFHpoc2A@mail.gmail.com>
@ 2013-06-25 23:29       ` Davidlohr Bueso
  2013-08-28 11:58         ` ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]) Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Davidlohr Bueso @ 2013-06-25 23:29 UTC (permalink / raw)
  To: sedat.dilek
  Cc: linux-next, linux-kernel, Stephen Rothwell, Andrew Morton,
	linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

On Tue, 2013-06-25 at 23:41 +0200, Sedat Dilek wrote:
> On Tue, Jun 25, 2013 at 10:33 PM, Davidlohr Bueso
> <davidlohr.bueso@hp.com> wrote:
> > On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
> > [...]
> >
> >> I did some more testing with Linux-Testing-Project (release:
> >> ltp-full-20130503) and next-20130624 (Monday) which has still the
> >> issue, here.
> >>
> >> If I revert the mentioned two commits from my local
> >> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
> >> is fine.
> >>
> >> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
> >>
> >>    root# ./runltp -f ipc
> >>
> >>    root# ./runltp -f syscalls
> >
> > These are nice test cases!
> >
> > So I was able to reproduce the issue with LTP and manually running
> > msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
> > before calling it. The following changes fixes the issue and passes all
> > 'runltp -f syscall' tests, could you give it a try?
> >
> 
> Cool, that fixes the issues here.
> 
> Building with fakeroot & make deb-pkg is now OK, again.
> 
> The syscalls/msgctl08 test-case ran successfully!

Andrew, could you pick this one up? I've made the patch on top of
3.10.0-rc7-next-20130625

Thanks.
Davidlohr

8<---------------------------------

From: Davidlohr Bueso <davidlohr.bueso@hp.com>
Subject: [PATCH] ipc,msq: fix race in msgrcv(2)

Sedat reported the following issue when building the latest linux-next:

Building via 'make deb-pkg' with fakeroot fails here like this:

make: *** [deb-pkg] Terminated
/usr/bin/fakeroot: line 181:  2386 Terminated
FAKEROOTKEY=$FAKEROOTKEY LD_LIBRARY_PATH="$PATHS" LD_PRELOAD="$LIB"
"$@"
semop(1): encountered an error: Identifier removed
semop(2): encountered an error: Invalid argument
semop(1): encountered an error: Identifier removed
semop(1): encountered an error: Identifier removed
semop(1): encountered an error: Invalid argument
semop(1): encountered an error: Invalid argument
semop(1): encountered an error: Invalid argument

The issue was caused by a race in find_msg(), so acquire the q_perm.lock
before calling the function. This also broke some LTP test cases:

<<<test_start>>>
tag=msgctl08 stime=1372174954
cmdline="msgctl08"
contacts=""
analysis=exit
<<<test_output>>>
msgctl08    0  TWARN  :  Verify error in child 0, *buf = 28, val = 27, size = 8
msgctl08    1  TFAIL  :  in child 0 read # = 73,key =  127
msgctl08    0  TWARN  :  Verify error in child 3, *buf = ffffff8a, val
= ffffff89, size = 52
msgctl08    1  TFAIL  :  in child 3 read # = 157,key =  189
msgctl08    0  TWARN  :  Verify error in child 2, *buf = ffffff87, val
= ffffff86, size = 71
msgctl08    1  TFAIL  :  in child 2 read # = 15954,key =  3e86
msgctl08    0  TWARN  :  Verify error in child 12, *buf = ffffffa9,
val = ffffffa8, size = 22
msgctl08    1  TFAIL  :  in child 12 read # = 12904,key =  32a8
msgctl08    0  TWARN  :  Verify error in child 13, *buf = 36, val =
35, size = 27
...

Also update a comment referring to ipc_lock_by_ptr(), which has already been deleted
and no longer applies to this context.

Reported-and-tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Davidlohr Bueso <davidlohr.bueso@hp.com>
---
 ipc/msg.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index a1cf70e..bd60d7e 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -895,6 +895,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 		if (ipcperms(ns, &msq->q_perm, S_IRUGO))
 			goto out_unlock1;
 
+		ipc_lock_object(&msq->q_perm);
 		msg = find_msg(msq, &msgtyp, mode);
 		if (!IS_ERR(msg)) {
 			/*
@@ -903,7 +904,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if ((bufsz < msg->m_ts) && !(msgflg & MSG_NOERROR)) {
 				msg = ERR_PTR(-E2BIG);
-				goto out_unlock1;
+				goto out_unlock0;
 			}
 			/*
 			 * If we are copying, then do not unlink message and do
@@ -911,10 +912,9 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 			 */
 			if (msgflg & MSG_COPY) {
 				msg = copy_msg(msg, copy);
-				goto out_unlock1;
+				goto out_unlock0;
 			}
 
-			ipc_lock_object(&msq->q_perm);
 			list_del(&msg->m_list);
 			msq->q_qnum--;
 			msq->q_rtime = get_seconds();
@@ -930,10 +930,9 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 		/* No message waiting. Wait for a message */
 		if (msgflg & IPC_NOWAIT) {
 			msg = ERR_PTR(-ENOMSG);
-			goto out_unlock1;
+			goto out_unlock0;
 		}
 
-		ipc_lock_object(&msq->q_perm);
 		list_add_tail(&msr_d.r_list, &msq->q_receivers);
 		msr_d.r_tsk = current;
 		msr_d.r_msgtype = msgtyp;
@@ -957,7 +956,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp, int msgfl
 		 * Prior to destruction, expunge_all(-EIRDM) changes r_msg.
 		 * Thus if r_msg is -EAGAIN, then the queue not yet destroyed.
 		 * rcu_read_lock() prevents preemption between reading r_msg
-		 * and the spin_lock() inside ipc_lock_by_ptr().
+		 * and acquiring the q_perm.lock in ipc_lock_object().
 		 */
 		rcu_read_lock();
 
-- 
1.7.11.7




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

* ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-06-25 23:29       ` Davidlohr Bueso
@ 2013-08-28 11:58         ` Vineet Gupta
  2013-08-29  3:04           ` Sedat Dilek
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-08-28 11:58 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: sedat.dilek, linux-next, linux-kernel, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 2607 bytes --]

Hi David,

On 06/26/2013 04:59 AM, Davidlohr Bueso wrote:
> On Tue, 2013-06-25 at 23:41 +0200, Sedat Dilek wrote:
>> On Tue, Jun 25, 2013 at 10:33 PM, Davidlohr Bueso
>> <davidlohr.bueso@hp.com> wrote:
>>> On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
>>> [...]
>>>
>>>> I did some more testing with Linux-Testing-Project (release:
>>>> ltp-full-20130503) and next-20130624 (Monday) which has still the
>>>> issue, here.
>>>>
>>>> If I revert the mentioned two commits from my local
>>>> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
>>>> is fine.
>>>>
>>>> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
>>>>
>>>>    root# ./runltp -f ipc
>>>>
>>>>    root# ./runltp -f syscalls
>>>
>>> These are nice test cases!
>>>
>>> So I was able to reproduce the issue with LTP and manually running
>>> msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
>>> before calling it. The following changes fixes the issue and passes all
>>> 'runltp -f syscall' tests, could you give it a try?
>>>
>>
>> Cool, that fixes the issues here.
>>
>> Building with fakeroot & make deb-pkg is now OK, again.
>>
>> The syscalls/msgctl08 test-case ran successfully!
> 
> Andrew, could you pick this one up? I've made the patch on top of
> 3.10.0-rc7-next-20130625

LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
bisected it, sigh... didn't look at this thread earlier :-( and landed into this.

------------->8------------------------------------
3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
Date:   Mon Jul 8 16:01:17 2013 -0700

    ipc,msg: shorten critical region in msgsnd

    do_msgsnd() is another function that does too many things with the ipc
    object lock acquired.  Take it only when needed when actually updating
    msq.
------------->8------------------------------------

If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
passes. I can confirm that linux-next also has the issue (didn't try the revert
there though).

1. arc 3.11-rc7 config attached (UP + PREEMPT)
2. dmesg prints "msgmni has been set to 479"
3. LTP output (this is slightly dated source, so prints might vary)

------------->8------------------------------------
<<<test_start>>>
tag=msgctl08 stime=1377689180
cmdline="msgctl08"
contacts=""
analysis=exit
initiation_status="ok"
<<<test_output>>>
------------->8-------- hung here ------------------


Let me know if you need more data/test help.

-Vineet

[-- Attachment #2: .config --]
[-- Type: text/plain, Size: 25142 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/arc 3.11.0-rc7 Kernel Configuration
#
CONFIG_ARC=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_GENERIC_CSUM=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_MMU=y
CONFIG_NO_IOPORT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
# CONFIG_NO_DMA is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
# CONFIG_FHANDLE is not set
# CONFIG_AUDIT is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set

#
# RCU Subsystem
#
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_FANOUT=32
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_BOOST is not set
# CONFIG_RCU_NOCB_CPU is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_CGROUPS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
CONFIG_IPC_NS=y
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
CONFIG_NET_NS=y
CONFIG_UIDGID_CONVERTED=y
# CONFIG_UIDGID_STRICT_TYPE_CHECKS is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_KPROBES=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_CLONE_BACKWARDS=y

#
# GCOV-based kernel profiling
#
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
# CONFIG_MODULE_SIG is not set
CONFIG_BLOCK=y
# CONFIG_LBDAF is not set
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_BSGLIB is not set
# CONFIG_BLK_DEV_INTEGRITY is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_UNINLINE_SPIN_UNLOCK=y
# CONFIG_FREEZER is not set

#
# ARC Architecture Configuration
#

#
# ARC Platform/SoC/Board
#
CONFIG_ARC_PLAT_FPGA_LEGACY=y
CONFIG_ARC_BOARD_ANGEL4=y
CONFIG_ARC_BOARD_ML509=y
CONFIG_ARC_SERIAL_BAUD=115200
# CONFIG_ARC_HAS_BVCI_LAT_UNIT is not set
CONFIG_ARC_IDE=y
CONFIG_ARC_BLK_DEV_IDEDMA=y
# CONFIG_ARC_PLAT_TB10X is not set

#
# ARC CPU Configuration
#
# CONFIG_ARC_CPU_750D is not set
CONFIG_ARC_CPU_770=y
# CONFIG_CPU_BIG_ENDIAN is not set
# CONFIG_SMP is not set
CONFIG_ARC_CACHE=y
CONFIG_ARC_CACHE_LINE_SHIFT=6
CONFIG_ARC_HAS_ICACHE=y
CONFIG_ARC_HAS_DCACHE=y
CONFIG_ARC_CACHE_PAGES=y
# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
# CONFIG_ARC_HAS_ICCM is not set
# CONFIG_ARC_HAS_DCCM is not set
CONFIG_ARC_HAS_HW_MPY=y
# CONFIG_ARC_MMU_V1 is not set
# CONFIG_ARC_MMU_V2 is not set
CONFIG_ARC_MMU_V3=y
CONFIG_ARC_PAGE_SIZE_8K=y
# CONFIG_ARC_PAGE_SIZE_16K is not set
# CONFIG_ARC_PAGE_SIZE_4K is not set
# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
# CONFIG_ARC_FPU_SAVE_RESTORE is not set
# CONFIG_ARC_CANT_LLSC is not set
CONFIG_ARC_CPU_REL_4_10=y
CONFIG_ARC_HAS_LLSC=y
CONFIG_ARC_HAS_SWAPE=y
# CONFIG_ARC_HAS_RTSC is not set
CONFIG_LINUX_LINK_BASE=0x80000000
CONFIG_ARC_CURR_IN_REG=y
# CONFIG_ARC_MISALIGN_ACCESS is not set
CONFIG_HZ=100
# CONFIG_ARC_METAWARE_HLINK is not set
CONFIG_ARC_DBG=y
CONFIG_ARC_DW2_UNWIND=y
# CONFIG_ARC_DBG_TLB_PARANOIA is not set
# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
# CONFIG_CMDLINE_UBOOT is not set
CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_NO_BOOTMEM=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_COMPACTION is not set
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_CLEANCACHE is not set
# CONFIG_ZBUD is not set
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
CONFIG_UNIX_DIAG=y
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
CONFIG_NET_KEY=y
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_NET_IPVTI is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
CONFIG_INET_LRO=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_MMAP is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_NET_MPLS_GSO is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_TCPPROBE is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
# CONFIG_LIB80211 is not set

#
# CFG80211 needs to be enabled for MAC80211
#
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
# CONFIG_STANDALONE is not set
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_DTC=y
CONFIG_OF=y

#
# Device Tree and Open Firmware support
#
# CONFIG_PROC_DEVICETREE is not set
# CONFIG_OF_SELFTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_NET=y
CONFIG_OF_MDIO=y
# CONFIG_PARPORT is not set
# CONFIG_BLK_DEV is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_ATMEL_SSC is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_SRAM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_93CX6 is not set

#
# Texas Instruments shared transport line discipline
#

#
# Altera FPGA firmware download module
#
CONFIG_HAVE_IDE=y
CONFIG_IDE=y

#
# Please see Documentation/ide/ide.txt for help/info on IDE drives
#
CONFIG_IDE_XFER_MODE=y
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_IDE_GD=y
CONFIG_IDE_GD_ATA=y
# CONFIG_IDE_GD_ATAPI is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_IDE_TASK_IOCTL is not set
CONFIG_IDE_PROC_FS=y

#
# IDE chipset support/bugfixes
#
# CONFIG_BLK_DEV_PLATFORM is not set
CONFIG_BLK_DEV_IDEDMA=y

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
# CONFIG_ATA is not set
# CONFIG_MD is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_TUN is not set
# CONFIG_VETH is not set
# CONFIG_NLMON is not set

#
# CAIF transport drivers
#

#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
# CONFIG_NET_DSA_MV88E6131 is not set
# CONFIG_NET_DSA_MV88E6123_61_65 is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_ARC=y
CONFIG_ARC_EMAC=y
CONFIG_NET_CADENCE=y
# CONFIG_ARM_AT91_ETHER is not set
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_INTEL=y
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MVMDIO is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8851_MLL is not set
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NET_VENDOR_8390=y
# CONFIG_ETHOC is not set
# CONFIG_SH_ETH is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_VIA=y
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_AT803X_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
CONFIG_LXT_PHY=y
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_FIXED_PHY is not set
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_WLAN=y
# CONFIG_HOSTAP is not set
# CONFIG_WL_TI is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
CONFIG_SERIAL_ARC=y
CONFIG_SERIAL_ARC_CONSOLE=y
CONFIG_SERIAL_ARC_NR_PORTS=1
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_TTY_PRINTK is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_R3964 is not set

#
# PCMCIA character devices
#
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_I2C is not set
# CONFIG_SPI is not set
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_GPIO_DEVRES=y
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_POWER_AVS is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
# CONFIG_MFD_CORE is not set
# CONFIG_MFD_CROS_EC is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set
# CONFIG_EXYNOS_VIDEO is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_SOUND is not set

#
# HID support
#
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_VIRT_DRIVERS is not set

#
# Virtio drivers
#
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set

#
# Hardware Spinlock drivers
#
# CONFIG_MAILBOX is not set
# CONFIG_IOMMU_SUPPORT is not set

#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set

#
# Rpmsg drivers
#
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_PWM is not set
CONFIG_IRQCHIP=y
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
# CONFIG_FMC is not set

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4_FS is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_FS_POSIX_ACL is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
# CONFIG_QUOTACTL is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_TMPFS_XATTR is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_SWAP is not set
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_NLS is not set

#
# Kernel hacking
#

#
# printk and dmesg options
#
# CONFIG_PRINTK_TIME is not set
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
# CONFIG_BOOT_PRINTK_DELAY is not set

#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_KERNEL=y

#
# Memory Debugging
#
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Lockups and Hangs
#
# CONFIG_LOCKUP_DETECTOR is not set
# CONFIG_DETECT_HUNG_TASK is not set
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set

#
# RCU Debugging
#
# CONFIG_PROVE_RCU_DELAY is not set
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=21
CONFIG_RCU_CPU_STALL_VERBOSE=y
# CONFIG_RCU_CPU_STALL_INFO is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set

#
# Runtime Testing
#
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_16KSTACKS is not set

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=m
# CONFIG_CRYPTO_MANAGER is not set
# CONFIG_CRYPTO_MANAGER2 is not set
# CONFIG_CRYPTO_USER is not set
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_XZ_DEC=y
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
# CONFIG_XZ_DEC_IA64 is not set
# CONFIG_XZ_DEC_ARM is not set
# CONFIG_XZ_DEC_ARMTHUMB is not set
# CONFIG_XZ_DEC_SPARC is not set
# CONFIG_XZ_DEC_BCJ is not set
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_DMA=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
# CONFIG_AVERAGE is not set
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set

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

* Re: ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-08-28 11:58         ` ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]) Vineet Gupta
@ 2013-08-29  3:04           ` Sedat Dilek
  2013-08-29  7:21             ` Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Sedat Dilek @ 2013-08-29  3:04 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Davidlohr Bueso, linux-next, LKML, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

On Wed, Aug 28, 2013 at 1:58 PM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
> Hi David,
>
> On 06/26/2013 04:59 AM, Davidlohr Bueso wrote:
>> On Tue, 2013-06-25 at 23:41 +0200, Sedat Dilek wrote:
>>> On Tue, Jun 25, 2013 at 10:33 PM, Davidlohr Bueso
>>> <davidlohr.bueso@hp.com> wrote:
>>>> On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
>>>> [...]
>>>>
>>>>> I did some more testing with Linux-Testing-Project (release:
>>>>> ltp-full-20130503) and next-20130624 (Monday) which has still the
>>>>> issue, here.
>>>>>
>>>>> If I revert the mentioned two commits from my local
>>>>> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
>>>>> is fine.
>>>>>
>>>>> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
>>>>>
>>>>>    root# ./runltp -f ipc
>>>>>
>>>>>    root# ./runltp -f syscalls
>>>>
>>>> These are nice test cases!
>>>>
>>>> So I was able to reproduce the issue with LTP and manually running
>>>> msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
>>>> before calling it. The following changes fixes the issue and passes all
>>>> 'runltp -f syscall' tests, could you give it a try?
>>>>
>>>
>>> Cool, that fixes the issues here.
>>>
>>> Building with fakeroot & make deb-pkg is now OK, again.
>>>
>>> The syscalls/msgctl08 test-case ran successfully!
>>
>> Andrew, could you pick this one up? I've made the patch on top of
>> 3.10.0-rc7-next-20130625
>
> LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
> bisected it, sigh... didn't look at this thread earlier :-( and landed into this.
>
> ------------->8------------------------------------
> 3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
> commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
> Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
> Date:   Mon Jul 8 16:01:17 2013 -0700
>
>     ipc,msg: shorten critical region in msgsnd
>
>     do_msgsnd() is another function that does too many things with the ipc
>     object lock acquired.  Take it only when needed when actually updating
>     msq.
> ------------->8------------------------------------
>
> If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
> passes. I can confirm that linux-next also has the issue (didn't try the revert
> there though).
>
> 1. arc 3.11-rc7 config attached (UP + PREEMPT)
> 2. dmesg prints "msgmni has been set to 479"
> 3. LTP output (this is slightly dated source, so prints might vary)
>
> ------------->8------------------------------------
> <<<test_start>>>
> tag=msgctl08 stime=1377689180
> cmdline="msgctl08"
> contacts=""
> analysis=exit
> initiation_status="ok"
> <<<test_output>>>
> ------------->8-------- hung here ------------------
>
>
> Let me know if you need more data/test help.
>

Cannot say much to your constellation as I had the issue on x86-64 and
Linux-next.
But I have just seen a post-v3.11-rc7 IPC-fix in [1].

I have here a v3.11-rc7 kernel with drm-intel-nightly on top... did not run LTP.

Which LTP release do you use?
Might be good to attach your kernel-config for followers?

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=368ae537e056acd3f751fa276f48423f06803922

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

* Re: ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-08-29  3:04           ` Sedat Dilek
@ 2013-08-29  7:21             ` Vineet Gupta
  2013-08-29  7:52               ` Sedat Dilek
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-08-29  7:21 UTC (permalink / raw)
  To: sedat.dilek@gmail.com
  Cc: Davidlohr Bueso, linux-next, LKML, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

On 08/29/2013 08:34 AM, Sedat Dilek wrote:
> On Wed, Aug 28, 2013 at 1:58 PM, Vineet Gupta
> <Vineet.Gupta1@synopsys.com> wrote:
>> Hi David,
>>
>> On 06/26/2013 04:59 AM, Davidlohr Bueso wrote:
>>> On Tue, 2013-06-25 at 23:41 +0200, Sedat Dilek wrote:
>>>> On Tue, Jun 25, 2013 at 10:33 PM, Davidlohr Bueso
>>>> <davidlohr.bueso@hp.com> wrote:
>>>>> On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
>>>>> [...]
>>>>>
>>>>>> I did some more testing with Linux-Testing-Project (release:
>>>>>> ltp-full-20130503) and next-20130624 (Monday) which has still the
>>>>>> issue, here.
>>>>>>
>>>>>> If I revert the mentioned two commits from my local
>>>>>> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
>>>>>> is fine.
>>>>>>
>>>>>> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
>>>>>>
>>>>>>    root# ./runltp -f ipc
>>>>>>
>>>>>>    root# ./runltp -f syscalls
>>>>> These are nice test cases!
>>>>>
>>>>> So I was able to reproduce the issue with LTP and manually running
>>>>> msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
>>>>> before calling it. The following changes fixes the issue and passes all
>>>>> 'runltp -f syscall' tests, could you give it a try?
>>>>>
>>>> Cool, that fixes the issues here.
>>>>
>>>> Building with fakeroot & make deb-pkg is now OK, again.
>>>>
>>>> The syscalls/msgctl08 test-case ran successfully!
>>> Andrew, could you pick this one up? I've made the patch on top of
>>> 3.10.0-rc7-next-20130625
>> LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
>> bisected it, sigh... didn't look at this thread earlier :-( and landed into this.
>>
>> ------------->8------------------------------------
>> 3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
>> commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
>> Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
>> Date:   Mon Jul 8 16:01:17 2013 -0700
>>
>>     ipc,msg: shorten critical region in msgsnd
>>
>>     do_msgsnd() is another function that does too many things with the ipc
>>     object lock acquired.  Take it only when needed when actually updating
>>     msq.
>> ------------->8------------------------------------
>>
>> If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
>> passes. I can confirm that linux-next also has the issue (didn't try the revert
>> there though).
>>
>> 1. arc 3.11-rc7 config attached (UP + PREEMPT)
>> 2. dmesg prints "msgmni has been set to 479"
>> 3. LTP output (this is slightly dated source, so prints might vary)
>>
>> ------------->8------------------------------------
>> <<<test_start>>>
>> tag=msgctl08 stime=1377689180
>> cmdline="msgctl08"
>> contacts=""
>> analysis=exit
>> initiation_status="ok"
>> <<<test_output>>>
>> ------------->8-------- hung here ------------------
>>
>>
>> Let me know if you need more data/test help.
>>
> Cannot say much to your constellation as I had the issue on x86-64 and
> Linux-next.
> But I have just seen a post-v3.11-rc7 IPC-fix in [1].
>
> I have here a v3.11-rc7 kernel with drm-intel-nightly on top... did not run LTP.

Not sure what you mean - I'd posted that Im seeing the issue on ARC Linux (an FPGA
board) 3.11-rc7 as well as linux-next of yesterday.

> Which LTP release do you use?

The LTP build I generally use is from a 2007 based sources (lazy me). However I
knew this would come up so before posting, I'd built the latest from buildroot and
ran the msgctl08 from there standalone and it did the same thing.

> Might be good to attach your kernel-config for followers?

It was already there in my orig msg - you probably missed it.

> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=368ae537e056acd3f751fa276f48423f06803922

I tried linux-next of today, same deal - msgctl08 still hangs.

-Vineet

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

* Re: ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-08-29  7:21             ` Vineet Gupta
@ 2013-08-29  7:52               ` Sedat Dilek
  2013-08-30  8:19                 ` Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Sedat Dilek @ 2013-08-29  7:52 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Davidlohr Bueso, linux-next, LKML, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel, Manfred Spraul,
	Jonathan Gonzalez

On Thu, Aug 29, 2013 at 9:21 AM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
> On 08/29/2013 08:34 AM, Sedat Dilek wrote:
>> On Wed, Aug 28, 2013 at 1:58 PM, Vineet Gupta
>> <Vineet.Gupta1@synopsys.com> wrote:
>>> Hi David,
>>>
>>> On 06/26/2013 04:59 AM, Davidlohr Bueso wrote:
>>>> On Tue, 2013-06-25 at 23:41 +0200, Sedat Dilek wrote:
>>>>> On Tue, Jun 25, 2013 at 10:33 PM, Davidlohr Bueso
>>>>> <davidlohr.bueso@hp.com> wrote:
>>>>>> On Tue, 2013-06-25 at 18:10 +0200, Sedat Dilek wrote:
>>>>>> [...]
>>>>>>
>>>>>>> I did some more testing with Linux-Testing-Project (release:
>>>>>>> ltp-full-20130503) and next-20130624 (Monday) which has still the
>>>>>>> issue, here.
>>>>>>>
>>>>>>> If I revert the mentioned two commits from my local
>>>>>>> revert-ipc-next20130624-5089fd1c6a6a-ab9efc2d0db5 GIT repo, everything
>>>>>>> is fine.
>>>>>>>
>>>>>>> I have tested the LTP ***IPC*** and ***SYSCALLS*** testcases.
>>>>>>>
>>>>>>>    root# ./runltp -f ipc
>>>>>>>
>>>>>>>    root# ./runltp -f syscalls
>>>>>> These are nice test cases!
>>>>>>
>>>>>> So I was able to reproduce the issue with LTP and manually running
>>>>>> msgctl08. We seemed to be racing at find_msg(), so take to q_perm lock
>>>>>> before calling it. The following changes fixes the issue and passes all
>>>>>> 'runltp -f syscall' tests, could you give it a try?
>>>>>>
>>>>> Cool, that fixes the issues here.
>>>>>
>>>>> Building with fakeroot & make deb-pkg is now OK, again.
>>>>>
>>>>> The syscalls/msgctl08 test-case ran successfully!
>>>> Andrew, could you pick this one up? I've made the patch on top of
>>>> 3.10.0-rc7-next-20130625
>>> LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
>>> bisected it, sigh... didn't look at this thread earlier :-( and landed into this.
>>>
>>> ------------->8------------------------------------
>>> 3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
>>> commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
>>> Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
>>> Date:   Mon Jul 8 16:01:17 2013 -0700
>>>
>>>     ipc,msg: shorten critical region in msgsnd
>>>
>>>     do_msgsnd() is another function that does too many things with the ipc
>>>     object lock acquired.  Take it only when needed when actually updating
>>>     msq.
>>> ------------->8------------------------------------
>>>
>>> If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
>>> passes. I can confirm that linux-next also has the issue (didn't try the revert
>>> there though).
>>>
>>> 1. arc 3.11-rc7 config attached (UP + PREEMPT)
>>> 2. dmesg prints "msgmni has been set to 479"
>>> 3. LTP output (this is slightly dated source, so prints might vary)
>>>
>>> ------------->8------------------------------------
>>> <<<test_start>>>
>>> tag=msgctl08 stime=1377689180
>>> cmdline="msgctl08"
>>> contacts=""
>>> analysis=exit
>>> initiation_status="ok"
>>> <<<test_output>>>
>>> ------------->8-------- hung here ------------------
>>>
>>>
>>> Let me know if you need more data/test help.
>>>
>> Cannot say much to your constellation as I had the issue on x86-64 and
>> Linux-next.
>> But I have just seen a post-v3.11-rc7 IPC-fix in [1].
>>
>> I have here a v3.11-rc7 kernel with drm-intel-nightly on top... did not run LTP.
>
> Not sure what you mean - I'd posted that Im seeing the issue on ARC Linux (an FPGA
> board) 3.11-rc7 as well as linux-next of yesterday.
>

I am not saying there is no issue, but I have no possibility to test
for ARC arch.

>> Which LTP release do you use?
>
> The LTP build I generally use is from a 2007 based sources (lazy me). However I
> knew this would come up so before posting, I'd built the latest from buildroot and
> ran the msgctl08 from there standalone and it did the same thing.
>

Try always latest LTP-stable (03-May-2013 is what I tried). AFAICS a
new release is planned soon.

>> Might be good to attach your kernel-config for followers?
>
> It was already there in my orig msg - you probably missed it.
>

I have got that response from you only :-).

>> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=368ae537e056acd3f751fa276f48423f06803922
>
> I tried linux-next of today, same deal - msgctl08 still hangs.
>

That above fix [1] in Linus-tree is also in next-20130828.

Hope Davidlohr and fellows can help you.

- Sedat -

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

* Re: ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-08-29  7:52               ` Sedat Dilek
@ 2013-08-30  8:19                 ` Vineet Gupta
  2013-08-30  8:27                   ` Sedat Dilek
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-08-30  8:19 UTC (permalink / raw)
  To: sedat.dilek
  Cc: linus Torvalds, Davidlohr Bueso, linux-next, LKML,
	Stephen Rothwell, Andrew Morton, linux-mm, Andi Kleen,
	Rik van Riel, Manfred Spraul, Jonathan Gonzalez

Ping ?

It seems 3.11 is pretty close to releasing but we stil have LTP msgctl08 causing a
hang (atleast on ARC) for both linux-next 20130829 as well as Linus tree.

So far, I haven't seemed to have drawn attention of people involved.

-Vineet

On 08/29/2013 01:22 PM, Sedat Dilek wrote:
> On Thu, Aug 29, 2013 at 9:21 AM, Vineet Gupta
> <Vineet.Gupta1@synopsys.com> wrote:
>> On 08/29/2013 08:34 AM, Sedat Dilek wrote:
>>> On Wed, Aug 28, 2013 at 1:58 PM, Vineet Gupta
>>> <Vineet.Gupta1@synopsys.com> wrote:
>>>> Hi David,
>>>>

[....]

>>>> LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
>>>> bisected it, sigh... didn't look at this thread earlier :-( and landed into this.
>>>>
>>>> ------------->8------------------------------------
>>>> 3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
>>>> commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
>>>> Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
>>>> Date:   Mon Jul 8 16:01:17 2013 -0700
>>>>
>>>>     ipc,msg: shorten critical region in msgsnd
>>>>
>>>>     do_msgsnd() is another function that does too many things with the ipc
>>>>     object lock acquired.  Take it only when needed when actually updating
>>>>     msq.
>>>> ------------->8------------------------------------
>>>>
>>>> If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
>>>> passes. I can confirm that linux-next also has the issue (didn't try the revert
>>>> there though).
>>>>
>>>> 1. arc 3.11-rc7 config attached (UP + PREEMPT)
>>>> 2. dmesg prints "msgmni has been set to 479"
>>>> 3. LTP output (this is slightly dated source, so prints might vary)
>>>>
>>>> ------------->8------------------------------------
>>>> <<<test_start>>>
>>>> tag=msgctl08 stime=1377689180
>>>> cmdline="msgctl08"
>>>> contacts=""
>>>> analysis=exit
>>>> initiation_status="ok"
>>>> <<<test_output>>>
>>>> ------------->8-------- hung here ------------------
>>>>
>>>>
>>>> Let me know if you need more data/test help.
>>>>
>>> Cannot say much to your constellation as I had the issue on x86-64 and
>>> Linux-next.
>>> But I have just seen a post-v3.11-rc7 IPC-fix in [1].
>>>
>>> I have here a v3.11-rc7 kernel with drm-intel-nightly on top... did not run LTP.
>>
>> Not sure what you mean - I'd posted that Im seeing the issue on ARC Linux (an FPGA
>> board) 3.11-rc7 as well as linux-next of yesterday.
>>
> 
> I am not saying there is no issue, but I have no possibility to test
> for ARC arch.
> 
>>> Which LTP release do you use?
>>
>> The LTP build I generally use is from a 2007 based sources (lazy me). However I
>> knew this would come up so before posting, I'd built the latest from buildroot and
>> ran the msgctl08 from there standalone and it did the same thing.
>>
> 
> Try always latest LTP-stable (03-May-2013 is what I tried). AFAICS a
> new release is planned soon.
> 
>>> Might be good to attach your kernel-config for followers?
>>
>> It was already there in my orig msg - you probably missed it.
>>
> 
> I have got that response from you only :-).
> 
>>> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=368ae537e056acd3f751fa276f48423f06803922
>>
>> I tried linux-next of today, same deal - msgctl08 still hangs.
>>
> 
> That above fix [1] in Linus-tree is also in next-20130828.
> 
> Hope Davidlohr and fellows can help you.
> 
> - Sedat -
> 


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

* Re: ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ])
  2013-08-30  8:19                 ` Vineet Gupta
@ 2013-08-30  8:27                   ` Sedat Dilek
  2013-08-30  8:46                     ` ipc-msg broken again on 3.11-rc7? Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Sedat Dilek @ 2013-08-30  8:27 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: linus Torvalds, Davidlohr Bueso, linux-next, LKML,
	Stephen Rothwell, Andrew Morton, linux-mm, Andi Kleen,
	Rik van Riel, Manfred Spraul, Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 3803 bytes --]

On Fri, Aug 30, 2013 at 10:19 AM, Vineet Gupta <vineetg76@gmail.com> wrote:
> Ping ?
>
> It seems 3.11 is pretty close to releasing but we stil have LTP msgctl08 causing a
> hang (atleast on ARC) for both linux-next 20130829 as well as Linus tree.
>
> So far, I haven't seemed to have drawn attention of people involved.
>

Hi Vineet,

I remember fakeroot was an another good test-case for me to test this
IPC breakage.
Attached is my build-script for Linux-next (tested with Debian/Ubuntu).
( Cannot say if you can play with it in your environment. )

Regards,
- Sedat -

> -Vineet
>
> On 08/29/2013 01:22 PM, Sedat Dilek wrote:
>> On Thu, Aug 29, 2013 at 9:21 AM, Vineet Gupta
>> <Vineet.Gupta1@synopsys.com> wrote:
>>> On 08/29/2013 08:34 AM, Sedat Dilek wrote:
>>>> On Wed, Aug 28, 2013 at 1:58 PM, Vineet Gupta
>>>> <Vineet.Gupta1@synopsys.com> wrote:
>>>>> Hi David,
>>>>>
>
> [....]
>
>>>>> LTP msgctl08 hangs on 3.11-rc7 (ARC port) with some of my local changes. I
>>>>> bisected it, sigh... didn't look at this thread earlier :-( and landed into this.
>>>>>
>>>>> ------------->8------------------------------------
>>>>> 3dd1f784ed6603d7ab1043e51e6371235edf2313 is the first bad commit
>>>>> commit 3dd1f784ed6603d7ab1043e51e6371235edf2313
>>>>> Author: Davidlohr Bueso <davidlohr.bueso@hp.com>
>>>>> Date:   Mon Jul 8 16:01:17 2013 -0700
>>>>>
>>>>>     ipc,msg: shorten critical region in msgsnd
>>>>>
>>>>>     do_msgsnd() is another function that does too many things with the ipc
>>>>>     object lock acquired.  Take it only when needed when actually updating
>>>>>     msq.
>>>>> ------------->8------------------------------------
>>>>>
>>>>> If I revert 3dd1f784ed66 and 9ad66ae "ipc: remove unused functions" - the test
>>>>> passes. I can confirm that linux-next also has the issue (didn't try the revert
>>>>> there though).
>>>>>
>>>>> 1. arc 3.11-rc7 config attached (UP + PREEMPT)
>>>>> 2. dmesg prints "msgmni has been set to 479"
>>>>> 3. LTP output (this is slightly dated source, so prints might vary)
>>>>>
>>>>> ------------->8------------------------------------
>>>>> <<<test_start>>>
>>>>> tag=msgctl08 stime=1377689180
>>>>> cmdline="msgctl08"
>>>>> contacts=""
>>>>> analysis=exit
>>>>> initiation_status="ok"
>>>>> <<<test_output>>>
>>>>> ------------->8-------- hung here ------------------
>>>>>
>>>>>
>>>>> Let me know if you need more data/test help.
>>>>>
>>>> Cannot say much to your constellation as I had the issue on x86-64 and
>>>> Linux-next.
>>>> But I have just seen a post-v3.11-rc7 IPC-fix in [1].
>>>>
>>>> I have here a v3.11-rc7 kernel with drm-intel-nightly on top... did not run LTP.
>>>
>>> Not sure what you mean - I'd posted that Im seeing the issue on ARC Linux (an FPGA
>>> board) 3.11-rc7 as well as linux-next of yesterday.
>>>
>>
>> I am not saying there is no issue, but I have no possibility to test
>> for ARC arch.
>>
>>>> Which LTP release do you use?
>>>
>>> The LTP build I generally use is from a 2007 based sources (lazy me). However I
>>> knew this would come up so before posting, I'd built the latest from buildroot and
>>> ran the msgctl08 from there standalone and it did the same thing.
>>>
>>
>> Try always latest LTP-stable (03-May-2013 is what I tried). AFAICS a
>> new release is planned soon.
>>
>>>> Might be good to attach your kernel-config for followers?
>>>
>>> It was already there in my orig msg - you probably missed it.
>>>
>>
>> I have got that response from you only :-).
>>
>>>> [1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=368ae537e056acd3f751fa276f48423f06803922
>>>
>>> I tried linux-next of today, same deal - msgctl08 still hangs.
>>>
>>
>> That above fix [1] in Linus-tree is also in next-20130828.
>>
>> Hope Davidlohr and fellows can help you.
>>
>> - Sedat -
>>
>

[-- Attachment #2: build_linux-next.sh --]
[-- Type: application/x-sh, Size: 4622 bytes --]

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-08-30  8:27                   ` Sedat Dilek
@ 2013-08-30  8:46                     ` Vineet Gupta
       [not found]                       ` <CALE5RAvaa4bb-9xAnBe07Yp2n+Nn4uGEgqpLrKMuOE8hhZv00Q@mail.gmail.com>
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-08-30  8:46 UTC (permalink / raw)
  To: sedat.dilek@gmail.com
  Cc: linus Torvalds, Davidlohr Bueso, linux-next, LKML,
	Stephen Rothwell, Andrew Morton, linux-mm, Andi Kleen,
	Rik van Riel, Manfred Spraul, Jonathan Gonzalez

On 08/30/2013 01:57 PM, Sedat Dilek wrote:
> On Fri, Aug 30, 2013 at 10:19 AM, Vineet Gupta <vineetg76@gmail.com> wrote:
>> Ping ?
>>
>> It seems 3.11 is pretty close to releasing but we stil have LTP msgctl08 causing a
>> hang (atleast on ARC) for both linux-next 20130829 as well as Linus tree.
>>
>> So far, I haven't seemed to have drawn attention of people involved.
>>
> 
> Hi Vineet,
> 
> I remember fakeroot was an another good test-case for me to test this
> IPC breakage.
> Attached is my build-script for Linux-next (tested with Debian/Ubuntu).
> ( Cannot say if you can play with it in your environment. )

Hi Sedat,

I have a simpler buildroot based rootfs (initramfs based) and LTP is run off of
NFS, although running of a local storage doesn't make a difference.

For me msgctl08 standalone (w/o hassle of running full LTP) is enough to trigger
it consistently.

P.S. sorry my sender address kept flipping - mailer was broken !

-Vineet


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

* Re: ipc-msg broken again on 3.11-rc7?
       [not found]                       ` <CALE5RAvaa4bb-9xAnBe07Yp2n+Nn4uGEgqpLrKMuOE8hhZv00Q@mail.gmail.com>
@ 2013-08-30 16:31                         ` Davidlohr Bueso
  2013-08-31 17:50                           ` Linus Torvalds
  0 siblings, 1 reply; 30+ messages in thread
From: Davidlohr Bueso @ 2013-08-30 16:31 UTC (permalink / raw)
  To: Vineet Gupta, sedat.dilek, linus Torvalds, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Manfred Spraul, Jonathan Gonzalez

> From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
> Date: Fri, Aug 30, 2013 at 4:46 AM
> Subject: Re: ipc-msg broken again on 3.11-rc7?
> To: "sedat.dilek@gmail.com" <sedat.dilek@gmail.com>
> Cc: linus Torvalds <torvalds@linux-foundation.org>, Davidlohr Bueso <davidlohr.bueso@hp.com>, linux-next <linux-next@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, Stephen Rothwell <sfr@canb.auug.org.au>, Andrew Morton <akpm@linux-foundation.org>, linux-mm <linux-mm@kvack.org>, Andi Kleen <andi@firstfloor.org>, Rik van Riel <riel@redhat.com>, Manfred Spraul <manfred@colorfullife.com>, Jonathan Gonzalez <jgonzalez@linets.cl>
>
>
> On 08/30/2013 01:57 PM, Sedat Dilek wrote:
> > On Fri, Aug 30, 2013 at 10:19 AM, Vineet Gupta <vineetg76@gmail.com> wrote:
> >> Ping ?
> >>
> >> It seems 3.11 is pretty close to releasing but we stil have LTP msgctl08 causing a
> >> hang (atleast on ARC) for both linux-next 20130829 as well as Linus tree.
> >>
> >> So far, I haven't seemed to have drawn attention of people involved.
> >>

I apologize for the delay, I am on vacations and wasnt interrupting my
days at the beach by checking email.

You mention that the msgctl08 test case just hangs, nothing
interesting in dmesg appart from "msgmni has been set to 479" (which
is a standard initialization message anyways)?

After a quick glance, I suspect that the problem might be because we
are calling security_msg_queue_msgsnd() without taking the lock. This
is similar to the issue Sedat reported in the original thread with
find_msg() concerning msgrcv. The rest of the code looks otherwise
standard. Unfortunately I dont have a computer available to write/test
such a fix. I think we can move calls to security_msg_queue_msgsnd()
to be done right before ss_add(), which would simplify the code
changes, something like:

...

/* queue full, wait: */
if (msgflg & IPC_NOWAIT) {
     err = -EAGAIN;
     goto out_unlock1;
}

ipc_lock_object(&msq->q_perm);
err = security_msg_queue_msgsnd(msq, msg, msgflg);
if (err)
    goto out_unlock0;

ss_add(msq, &s);

...


Thanks,
Davidlohr


> >
> > Hi Vineet,
> >
> > I remember fakeroot was an another good test-case for me to test this
> > IPC breakage.
> > Attached is my build-script for Linux-next (tested with Debian/Ubuntu).
> > ( Cannot say if you can play with it in your environment. )
>
> Hi Sedat,
>
> I have a simpler buildroot based rootfs (initramfs based) and LTP is run off of
> NFS, although running of a local storage doesn't make a difference.
>
> For me msgctl08 standalone (w/o hassle of running full LTP) is enough to trigger
> it consistently.
>
> P.S. sorry my sender address kept flipping - mailer was broken !
>
> -Vineet
>
>

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-08-30 16:31                         ` Davidlohr Bueso
@ 2013-08-31 17:50                           ` Linus Torvalds
  2013-09-02  4:58                             ` Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Linus Torvalds @ 2013-08-31 17:50 UTC (permalink / raw)
  To: Davidlohr Bueso
  Cc: Vineet Gupta, Sedat Dilek, Davidlohr Bueso, linux-next, LKML,
	Stephen Rothwell, Andrew Morton, linux-mm, Andi Kleen,
	Rik van Riel, Manfred Spraul, Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

Vineet, actual patch for what Davidlohr suggests attached. Can you try it?

             Linus

On Fri, Aug 30, 2013 at 9:31 AM, Davidlohr Bueso <dave.bueso@gmail.com> wrote:
>
> After a quick glance, I suspect that the problem might be because we
> are calling security_msg_queue_msgsnd() without taking the lock. This
> is similar to the issue Sedat reported in the original thread with
> find_msg() concerning msgrcv.

[-- Attachment #2: patch.diff --]
[-- Type: application/octet-stream, Size: 782 bytes --]

 ipc/msg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipc/msg.c b/ipc/msg.c
index 9f29d9e89bac..5600c8b0d184 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -687,10 +687,6 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		if (ipcperms(ns, &msq->q_perm, S_IWUGO))
 			goto out_unlock1;
 
-		err = security_msg_queue_msgsnd(msq, msg, msgflg);
-		if (err)
-			goto out_unlock1;
-
 		if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
 				1 + msq->q_qnum <= msq->q_qbytes) {
 			break;
@@ -703,6 +699,10 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		}
 
 		ipc_lock_object(&msq->q_perm);
+		err = security_msg_queue_msgsnd(msq, msg, msgflg);
+		if (err)
+			goto out_unlock0;
+
 		ss_add(msq, &s);
 
 		if (!ipc_rcu_getref(msq)) {

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-08-31 17:50                           ` Linus Torvalds
@ 2013-09-02  4:58                             ` Vineet Gupta
  2013-09-02 16:29                               ` Manfred Spraul
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-02  4:58 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso, linux-next, LKML,
	Stephen Rothwell, Andrew Morton, linux-mm, Andi Kleen,
	Rik van Riel, Manfred Spraul, Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

On 08/31/2013 11:20 PM, Linus Torvalds wrote:
> Vineet, actual patch for what Davidlohr suggests attached. Can you try it?
>
>              Linus

Apologies for late in getting back to this - I was away from my computer for a bit.

Unfortunately, with a quick test, this patch doesn't help.
FWIW, this is latest mainline (.config attached).

Let me know what diagnostics I can add to help with this.

-Vineet

>
> On Fri, Aug 30, 2013 at 9:31 AM, Davidlohr Bueso <dave.bueso@gmail.com> wrote:
>> After a quick glance, I suspect that the problem might be because we
>> are calling security_msg_queue_msgsnd() without taking the lock. This
>> is similar to the issue Sedat reported in the original thread with
>> find_msg() concerning msgrcv.


[-- Attachment #2: ATT53981.config --]
[-- Type: text/plain, Size: 25153 bytes --]

#
# Automatically generated file; DO NOT EDIT.
# Linux/arc 3.11.0-rc7 Kernel Configuration
#
CONFIG_ARC=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_GENERIC_CSUM=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_MMU=y
CONFIG_NO_IOPORT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
# CONFIG_NO_DMA is not set
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_IRQ_WORK=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE="arc-linux-uclibc-"
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_DEFAULT_HOSTNAME="ARCLinux"
# CONFIG_SWAP is not set
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
# CONFIG_FHANDLE is not set
# CONFIG_AUDIT is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y

#
# IRQ subsystem
#
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y

#
# Timers subsystem
#
CONFIG_TICK_ONESHOT=y
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ is not set
CONFIG_HIGH_RES_TIMERS=y

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_TASKSTATS is not set

#
# RCU Subsystem
#
CONFIG_TREE_PREEMPT_RCU=y
CONFIG_PREEMPT_RCU=y
CONFIG_RCU_STALL_COMMON=y
CONFIG_RCU_FANOUT=32
CONFIG_RCU_FANOUT_LEAF=16
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_BOOST is not set
# CONFIG_RCU_NOCB_CPU is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_CGROUPS is not set
# CONFIG_CHECKPOINT_RESTORE is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
CONFIG_IPC_NS=y
# CONFIG_USER_NS is not set
# CONFIG_PID_NS is not set
CONFIG_NET_NS=y
CONFIG_UIDGID_CONVERTED=y
# CONFIG_UIDGID_STRICT_TYPE_CHECKS is not set
# CONFIG_SCHED_AUTOGROUP is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="../arc_initramfs/"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
# CONFIG_RD_XZ is not set
# CONFIG_RD_LZO is not set
# CONFIG_RD_LZ4 is not set
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EXPERT=y
# CONFIG_SYSCTL_SYSCALL is not set
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SIGNALFD=y
CONFIG_TIMERFD=y
CONFIG_EVENTFD=y
CONFIG_SHMEM=y
CONFIG_AIO=y
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_USE_VMALLOC=y

#
# Kernel Performance Events And Counters
#
# CONFIG_PERF_EVENTS is not set
CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_SLUB_DEBUG is not set
# CONFIG_COMPAT_BRK is not set
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SLUB_CPU_PARTIAL=y
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
CONFIG_KPROBES=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_KRETPROBES=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_CLONE_BACKWARDS=y

#
# GCOV-based kernel profiling
#
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_RT_MUTEXES=y
CONFIG_BASE_SMALL=0
CONFIG_MODULES=y
# CONFIG_MODULE_FORCE_LOAD is not set
# CONFIG_MODULE_UNLOAD is not set
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
# CONFIG_MODULE_SIG is not set
CONFIG_BLOCK=y
# CONFIG_LBDAF is not set
# CONFIG_BLK_DEV_BSG is not set
# CONFIG_BLK_DEV_BSGLIB is not set
# CONFIG_BLK_DEV_INTEGRITY is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"
CONFIG_UNINLINE_SPIN_UNLOCK=y
# CONFIG_FREEZER is not set

#
# ARC Architecture Configuration
#

#
# ARC Platform/SoC/Board
#
CONFIG_ARC_PLAT_FPGA_LEGACY=y
CONFIG_ARC_BOARD_ANGEL4=y
CONFIG_ARC_BOARD_ML509=y
CONFIG_ARC_SERIAL_BAUD=115200
# CONFIG_ARC_HAS_BVCI_LAT_UNIT is not set
CONFIG_ARC_IDE=y
CONFIG_ARC_BLK_DEV_IDEDMA=y
# CONFIG_ARC_PLAT_TB10X is not set

#
# ARC CPU Configuration
#
# CONFIG_ARC_CPU_750D is not set
CONFIG_ARC_CPU_770=y
# CONFIG_CPU_BIG_ENDIAN is not set
# CONFIG_SMP is not set
CONFIG_ARC_CACHE=y
CONFIG_ARC_CACHE_LINE_SHIFT=6
CONFIG_ARC_HAS_ICACHE=y
CONFIG_ARC_HAS_DCACHE=y
CONFIG_ARC_CACHE_PAGES=y
# CONFIG_ARC_CACHE_VIPT_ALIASING is not set
# CONFIG_ARC_HAS_ICCM is not set
# CONFIG_ARC_HAS_DCCM is not set
CONFIG_ARC_HAS_HW_MPY=y
# CONFIG_ARC_MMU_V1 is not set
# CONFIG_ARC_MMU_V2 is not set
CONFIG_ARC_MMU_V3=y
CONFIG_ARC_PAGE_SIZE_8K=y
# CONFIG_ARC_PAGE_SIZE_16K is not set
# CONFIG_ARC_PAGE_SIZE_4K is not set
# CONFIG_ARC_COMPACT_IRQ_LEVELS is not set
# CONFIG_ARC_FPU_SAVE_RESTORE is not set
# CONFIG_ARC_CANT_LLSC is not set
CONFIG_ARC_CPU_REL_4_10=y
CONFIG_ARC_HAS_LLSC=y
CONFIG_ARC_HAS_SWAPE=y
# CONFIG_ARC_HAS_RTSC is not set
CONFIG_LINUX_LINK_BASE=0x80000000
CONFIG_ARC_CURR_IN_REG=y
# CONFIG_ARC_MISALIGN_ACCESS is not set
CONFIG_HZ=100
# CONFIG_ARC_METAWARE_HLINK is not set
CONFIG_ARC_DBG=y
CONFIG_ARC_DW2_UNWIND=y
# CONFIG_ARC_DBG_TLB_PARANOIA is not set
# CONFIG_ARC_DBG_TLB_MISS_COUNT is not set
# CONFIG_CMDLINE_UBOOT is not set
CONFIG_ARC_BUILTIN_DTB_NAME="angel4"
# CONFIG_PREEMPT_NONE is not set
# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
CONFIG_PREEMPT_COUNT=y

#
# Executable file formats
#
CONFIG_BINFMT_ELF=y
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_BINFMT_SCRIPT=y
# CONFIG_HAVE_AOUT is not set
# CONFIG_BINFMT_MISC is not set
CONFIG_COREDUMP=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_NO_BOOTMEM=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
# CONFIG_COMPACTION is not set
# CONFIG_PHYS_ADDR_T_64BIT is not set
CONFIG_ZONE_DMA_FLAG=0
# CONFIG_KSM is not set
CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
# CONFIG_CROSS_MEMORY_ATTACH is not set
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_CLEANCACHE is not set
# CONFIG_ZBUD is not set
CONFIG_NET=y

#
# Networking options
#
CONFIG_PACKET=y
# CONFIG_PACKET_DIAG is not set
CONFIG_UNIX=y
CONFIG_UNIX_DIAG=y
CONFIG_XFRM=y
CONFIG_XFRM_ALGO=y
# CONFIG_XFRM_USER is not set
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
CONFIG_NET_KEY=y
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE_DEMUX is not set
# CONFIG_NET_IP_TUNNEL is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_NET_IPVTI is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
# CONFIG_INET_TUNNEL is not set
CONFIG_INET_XFRM_MODE_TRANSPORT=y
CONFIG_INET_XFRM_MODE_TUNNEL=y
CONFIG_INET_XFRM_MODE_BEET=y
CONFIG_INET_LRO=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
# CONFIG_INET_UDP_DIAG is not set
# CONFIG_TCP_CONG_ADVANCED is not set
CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
# CONFIG_IPV6 is not set
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
# CONFIG_NETFILTER is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
# CONFIG_TIPC is not set
# CONFIG_ATM is not set
# CONFIG_L2TP is not set
# CONFIG_BRIDGE is not set
CONFIG_HAVE_NET_DSA=y
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
# CONFIG_BATMAN_ADV is not set
# CONFIG_OPENVSWITCH is not set
# CONFIG_VSOCKETS is not set
# CONFIG_NETLINK_MMAP is not set
# CONFIG_NETLINK_DIAG is not set
# CONFIG_NET_MPLS_GSO is not set
CONFIG_NET_RX_BUSY_POLL=y
CONFIG_BQL=y

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NET_TCPPROBE is not set
# CONFIG_HAMRADIO is not set
# CONFIG_CAN is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_AF_RXRPC is not set
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
# CONFIG_LIB80211 is not set

#
# CFG80211 needs to be enabled for MAC80211
#
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set
# CONFIG_STANDALONE is not set
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
CONFIG_FW_LOADER_USER_HELPER=y
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_GENERIC_CPU_DEVICES is not set
# CONFIG_DMA_SHARED_BUFFER is not set

#
# Bus devices
#
# CONFIG_CONNECTOR is not set
# CONFIG_MTD is not set
CONFIG_DTC=y
CONFIG_OF=y

#
# Device Tree and Open Firmware support
#
# CONFIG_PROC_DEVICETREE is not set
# CONFIG_OF_SELFTEST is not set
CONFIG_OF_FLATTREE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_IRQ=y
CONFIG_OF_NET=y
CONFIG_OF_MDIO=y
# CONFIG_PARPORT is not set
# CONFIG_BLK_DEV is not set

#
# Misc devices
#
# CONFIG_SENSORS_LIS3LV02D is not set
# CONFIG_DUMMY_IRQ is not set
# CONFIG_ATMEL_SSC is not set
# CONFIG_ENCLOSURE_SERVICES is not set
# CONFIG_SRAM is not set
# CONFIG_C2PORT is not set

#
# EEPROM support
#
# CONFIG_EEPROM_93CX6 is not set

#
# Texas Instruments shared transport line discipline
#

#
# Altera FPGA firmware download module
#
CONFIG_HAVE_IDE=y
CONFIG_IDE=y

#
# Please see Documentation/ide/ide.txt for help/info on IDE drives
#
CONFIG_IDE_XFER_MODE=y
# CONFIG_BLK_DEV_IDE_SATA is not set
CONFIG_IDE_GD=y
CONFIG_IDE_GD_ATA=y
# CONFIG_IDE_GD_ATAPI is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_IDETAPE is not set
# CONFIG_IDE_TASK_IOCTL is not set
CONFIG_IDE_PROC_FS=y

#
# IDE chipset support/bugfixes
#
# CONFIG_BLK_DEV_PLATFORM is not set
CONFIG_BLK_DEV_IDEDMA=y

#
# SCSI device support
#
CONFIG_SCSI_MOD=y
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_DMA is not set
# CONFIG_SCSI_NETLINK is not set
# CONFIG_ATA is not set
# CONFIG_MD is not set
CONFIG_NETDEVICES=y
CONFIG_MII=y
CONFIG_NET_CORE=y
# CONFIG_BONDING is not set
# CONFIG_DUMMY is not set
# CONFIG_EQUALIZER is not set
# CONFIG_NET_TEAM is not set
# CONFIG_MACVLAN is not set
# CONFIG_VXLAN is not set
# CONFIG_NETCONSOLE is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_TUN is not set
# CONFIG_VETH is not set
# CONFIG_NLMON is not set

#
# CAIF transport drivers
#

#
# Distributed Switch Architecture drivers
#
# CONFIG_NET_DSA_MV88E6XXX is not set
# CONFIG_NET_DSA_MV88E6060 is not set
# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
# CONFIG_NET_DSA_MV88E6131 is not set
# CONFIG_NET_DSA_MV88E6123_61_65 is not set
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_ARC=y
CONFIG_ARC_EMAC=y
CONFIG_NET_CADENCE=y
# CONFIG_ARM_AT91_ETHER is not set
# CONFIG_MACB is not set
CONFIG_NET_VENDOR_BROADCOM=y
# CONFIG_B44 is not set
# CONFIG_NET_CALXEDA_XGMAC is not set
# CONFIG_DNET is not set
CONFIG_NET_VENDOR_INTEL=y
CONFIG_NET_VENDOR_I825XX=y
CONFIG_NET_VENDOR_MARVELL=y
# CONFIG_MVMDIO is not set
CONFIG_NET_VENDOR_MICREL=y
# CONFIG_KS8851_MLL is not set
CONFIG_NET_VENDOR_NATSEMI=y
CONFIG_NET_VENDOR_8390=y
# CONFIG_ETHOC is not set
# CONFIG_SH_ETH is not set
CONFIG_NET_VENDOR_SEEQ=y
CONFIG_NET_VENDOR_STMICRO=y
# CONFIG_STMMAC_ETH is not set
CONFIG_NET_VENDOR_VIA=y
CONFIG_NET_VENDOR_WIZNET=y
# CONFIG_WIZNET_W5100 is not set
# CONFIG_WIZNET_W5300 is not set
CONFIG_PHYLIB=y

#
# MII PHY device drivers
#
# CONFIG_AT803X_PHY is not set
# CONFIG_AMD_PHY is not set
# CONFIG_MARVELL_PHY is not set
# CONFIG_DAVICOM_PHY is not set
# CONFIG_QSEMI_PHY is not set
# CONFIG_LXT_PHY is not set
# CONFIG_CICADA_PHY is not set
# CONFIG_VITESSE_PHY is not set
# CONFIG_SMSC_PHY is not set
# CONFIG_BROADCOM_PHY is not set
# CONFIG_BCM87XX_PHY is not set
# CONFIG_ICPLUS_PHY is not set
# CONFIG_REALTEK_PHY is not set
# CONFIG_NATIONAL_PHY is not set
# CONFIG_STE10XP is not set
# CONFIG_LSI_ET1011C_PHY is not set
# CONFIG_MICREL_PHY is not set
# CONFIG_FIXED_PHY is not set
# CONFIG_MDIO_BITBANG is not set
# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
CONFIG_WLAN=y
# CONFIG_HOSTAP is not set
# CONFIG_WL_TI is not set

#
# Enable WiMAX (Networking options) to see the WiMAX drivers
#
# CONFIG_WAN is not set
# CONFIG_ISDN is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set
# CONFIG_INPUT_POLLDEV is not set
# CONFIG_INPUT_SPARSEKMAP is not set
# CONFIG_INPUT_MATRIXKMAP is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
# CONFIG_SERIO is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_TTY=y
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_LEGACY_PTYS is not set
# CONFIG_SERIAL_NONSTANDARD is not set
# CONFIG_N_GSM is not set
# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
# CONFIG_SERIAL_SCCNXP is not set
# CONFIG_SERIAL_TIMBERDALE is not set
# CONFIG_SERIAL_ALTERA_JTAGUART is not set
# CONFIG_SERIAL_ALTERA_UART is not set
# CONFIG_SERIAL_XILINX_PS_UART is not set
CONFIG_SERIAL_ARC=y
CONFIG_SERIAL_ARC_CONSOLE=y
CONFIG_SERIAL_ARC_NR_PORTS=1
# CONFIG_SERIAL_FSL_LPUART is not set
# CONFIG_TTY_PRINTK is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_R3964 is not set

#
# PCMCIA character devices
#
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
# CONFIG_I2C is not set
# CONFIG_SPI is not set
# CONFIG_HSI is not set

#
# PPS support
#
# CONFIG_PPS is not set

#
# PPS generators support
#

#
# PTP clock support
#
# CONFIG_PTP_1588_CLOCK is not set

#
# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
#
CONFIG_GPIO_DEVRES=y
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
# CONFIG_POWER_AVS is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
# CONFIG_WATCHDOG is not set
CONFIG_SSB_POSSIBLE=y

#
# Sonics Silicon Backplane
#
# CONFIG_SSB is not set
CONFIG_BCMA_POSSIBLE=y

#
# Broadcom specific AMBA
#
# CONFIG_BCMA is not set

#
# Multifunction device drivers
#
# CONFIG_MFD_CORE is not set
# CONFIG_MFD_CROS_EC is not set
# CONFIG_HTC_PASIC3 is not set
# CONFIG_MFD_KEMPLD is not set
# CONFIG_MFD_SM501 is not set
# CONFIG_ABX500_CORE is not set
# CONFIG_MFD_SYSCON is not set
# CONFIG_MFD_TI_AM335X_TSCADC is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_REGULATOR is not set
# CONFIG_MEDIA_SUPPORT is not set

#
# Graphics support
#
# CONFIG_DRM is not set
# CONFIG_VGASTATE is not set
# CONFIG_VIDEO_OUTPUT_CONTROL is not set
# CONFIG_FB is not set
# CONFIG_EXYNOS_VIDEO is not set
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Console display driver support
#
# CONFIG_VGA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_SOUND is not set

#
# HID support
#
# CONFIG_HID is not set
# CONFIG_USB_SUPPORT is not set
# CONFIG_MMC is not set
# CONFIG_MEMSTICK is not set
# CONFIG_NEW_LEDS is not set
# CONFIG_ACCESSIBILITY is not set
# CONFIG_RTC_CLASS is not set
# CONFIG_DMADEVICES is not set
# CONFIG_AUXDISPLAY is not set
# CONFIG_UIO is not set
# CONFIG_VIRT_DRIVERS is not set

#
# Virtio drivers
#
# CONFIG_VIRTIO_MMIO is not set

#
# Microsoft Hyper-V guest support
#
# CONFIG_STAGING is not set

#
# Hardware Spinlock drivers
#
# CONFIG_MAILBOX is not set
# CONFIG_IOMMU_SUPPORT is not set

#
# Remoteproc drivers
#
# CONFIG_STE_MODEM_RPROC is not set

#
# Rpmsg drivers
#
# CONFIG_PM_DEVFREQ is not set
# CONFIG_EXTCON is not set
# CONFIG_MEMORY is not set
# CONFIG_IIO is not set
# CONFIG_PWM is not set
CONFIG_IRQCHIP=y
# CONFIG_IPACK_BUS is not set
# CONFIG_RESET_CONTROLLER is not set
# CONFIG_FMC is not set

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
# CONFIG_EXT2_FS_POSIX_ACL is not set
# CONFIG_EXT2_FS_SECURITY is not set
# CONFIG_EXT2_FS_XIP is not set
# CONFIG_EXT3_FS is not set
# CONFIG_EXT4_FS is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_BTRFS_FS is not set
# CONFIG_NILFS2_FS is not set
# CONFIG_FS_POSIX_ACL is not set
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
CONFIG_DNOTIFY=y
CONFIG_INOTIFY_USER=y
# CONFIG_FANOTIFY is not set
# CONFIG_QUOTA is not set
# CONFIG_QUOTACTL is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set

#
# Caches
#
# CONFIG_FSCACHE is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
# CONFIG_TMPFS_XATTR is not set
# CONFIG_HUGETLB_PAGE is not set
# CONFIG_CONFIGFS_FS is not set
# CONFIG_MISC_FILESYSTEMS is not set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_SWAP is not set
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
# CONFIG_SUNRPC_DEBUG is not set
# CONFIG_CEPH_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
# CONFIG_NLS is not set

#
# Kernel hacking
#

#
# printk and dmesg options
#
# CONFIG_PRINTK_TIME is not set
CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
# CONFIG_BOOT_PRINTK_DELAY is not set

#
# Compile-time checks and compiler options
#
# CONFIG_DEBUG_INFO is not set
# CONFIG_ENABLE_WARN_DEPRECATED is not set
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_READABLE_ASM is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
# CONFIG_MAGIC_SYSRQ is not set
CONFIG_DEBUG_KERNEL=y

#
# Memory Debugging
#
# CONFIG_DEBUG_PAGEALLOC is not set
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_STATS is not set
# CONFIG_DEBUG_STACK_USAGE is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
# CONFIG_DEBUG_STACKOVERFLOW is not set
# CONFIG_DEBUG_SHIRQ is not set

#
# Debug Lockups and Hangs
#
# CONFIG_LOCKUP_DETECTOR is not set
# CONFIG_DETECT_HUNG_TASK is not set
# CONFIG_PANIC_ON_OOPS is not set
CONFIG_PANIC_ON_OOPS_VALUE=0
CONFIG_SCHED_DEBUG=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_TIMER_STATS is not set

#
# Lock Debugging (spinlocks, mutexes, etc...)
#
# CONFIG_DEBUG_RT_MUTEXES is not set
# CONFIG_RT_MUTEX_TESTER is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_DEBUG_ATOMIC_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
CONFIG_STACKTRACE=y
# CONFIG_DEBUG_KOBJECT is not set
# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_LIST is not set
# CONFIG_DEBUG_SG is not set
# CONFIG_DEBUG_NOTIFIERS is not set
# CONFIG_DEBUG_CREDENTIALS is not set

#
# RCU Debugging
#
# CONFIG_PROVE_RCU_DELAY is not set
# CONFIG_SPARSE_RCU_POINTER is not set
# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=21
CONFIG_RCU_CPU_STALL_VERBOSE=y
# CONFIG_RCU_CPU_STALL_INFO is not set
# CONFIG_RCU_TRACE is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
# CONFIG_NOTIFIER_ERROR_INJECTION is not set
# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set

#
# Runtime Testing
#
# CONFIG_TEST_LIST_SORT is not set
# CONFIG_KPROBES_SANITY_TEST is not set
# CONFIG_BACKTRACE_SELF_TEST is not set
# CONFIG_RBTREE_TEST is not set
# CONFIG_INTERVAL_TREE_TEST is not set
# CONFIG_ATOMIC64_SELFTEST is not set
# CONFIG_TEST_STRING_HELPERS is not set
# CONFIG_TEST_KSTRTOX is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
# CONFIG_KGDB is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_16KSTACKS is not set

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITYFS is not set
CONFIG_DEFAULT_SECURITY_DAC=y
CONFIG_DEFAULT_SECURITY=""
CONFIG_CRYPTO=y

#
# Crypto core or helper
#
# CONFIG_CRYPTO_FIPS is not set
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_RNG=m
CONFIG_CRYPTO_RNG2=m
# CONFIG_CRYPTO_MANAGER is not set
# CONFIG_CRYPTO_MANAGER2 is not set
# CONFIG_CRYPTO_USER is not set
# CONFIG_CRYPTO_GF128MUL is not set
# CONFIG_CRYPTO_NULL is not set
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
# CONFIG_CRYPTO_TEST is not set

#
# Authenticated Encryption with Associated Data
#
# CONFIG_CRYPTO_CCM is not set
# CONFIG_CRYPTO_GCM is not set
# CONFIG_CRYPTO_SEQIV is not set

#
# Block modes
#
# CONFIG_CRYPTO_CBC is not set
# CONFIG_CRYPTO_CTR is not set
# CONFIG_CRYPTO_CTS is not set
# CONFIG_CRYPTO_ECB is not set
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
# CONFIG_CRYPTO_XTS is not set

#
# Hash modes
#
# CONFIG_CRYPTO_CMAC is not set
# CONFIG_CRYPTO_HMAC is not set
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set

#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
# CONFIG_CRYPTO_CRC32 is not set
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
# CONFIG_CRYPTO_MD5 is not set
# CONFIG_CRYPTO_MICHAEL_MIC is not set
# CONFIG_CRYPTO_RMD128 is not set
# CONFIG_CRYPTO_RMD160 is not set
# CONFIG_CRYPTO_RMD256 is not set
# CONFIG_CRYPTO_RMD320 is not set
# CONFIG_CRYPTO_SHA1 is not set
# CONFIG_CRYPTO_SHA256 is not set
# CONFIG_CRYPTO_SHA512 is not set
# CONFIG_CRYPTO_TGR192 is not set
# CONFIG_CRYPTO_WP512 is not set

#
# Ciphers
#
CONFIG_CRYPTO_AES=y
# CONFIG_CRYPTO_ANUBIS is not set
# CONFIG_CRYPTO_ARC4 is not set
# CONFIG_CRYPTO_BLOWFISH is not set
# CONFIG_CRYPTO_CAMELLIA is not set
# CONFIG_CRYPTO_CAST5 is not set
# CONFIG_CRYPTO_CAST6 is not set
# CONFIG_CRYPTO_DES is not set
# CONFIG_CRYPTO_FCRYPT is not set
# CONFIG_CRYPTO_KHAZAD is not set
# CONFIG_CRYPTO_SALSA20 is not set
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
# CONFIG_CRYPTO_TWOFISH is not set

#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set
# CONFIG_CRYPTO_LZ4 is not set
# CONFIG_CRYPTO_LZ4HC is not set

#
# Random Number Generation
#
CONFIG_CRYPTO_ANSI_CPRNG=m
# CONFIG_CRYPTO_USER_API_HASH is not set
# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
CONFIG_CRYPTO_HW=y
# CONFIG_BINARY_PRINTF is not set

#
# Library routines
#
CONFIG_BITREVERSE=y
CONFIG_GENERIC_NET_UTILS=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_IO=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_T10DIF is not set
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC32_SELFTEST is not set
CONFIG_CRC32_SLICEBY8=y
# CONFIG_CRC32_SLICEBY4 is not set
# CONFIG_CRC32_SARWATE is not set
# CONFIG_CRC32_BIT is not set
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
# CONFIG_CRC8 is not set
CONFIG_ZLIB_INFLATE=y
CONFIG_XZ_DEC=y
# CONFIG_XZ_DEC_X86 is not set
# CONFIG_XZ_DEC_POWERPC is not set
# CONFIG_XZ_DEC_IA64 is not set
# CONFIG_XZ_DEC_ARM is not set
# CONFIG_XZ_DEC_ARMTHUMB is not set
# CONFIG_XZ_DEC_SPARC is not set
# CONFIG_XZ_DEC_BCJ is not set
# CONFIG_XZ_DEC_TEST is not set
CONFIG_DECOMPRESS_GZIP=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_DMA=y
CONFIG_DQL=y
CONFIG_NLATTR=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
# CONFIG_AVERAGE is not set
# CONFIG_CORDIC is not set
# CONFIG_DDR is not set

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-02  4:58                             ` Vineet Gupta
@ 2013-09-02 16:29                               ` Manfred Spraul
  2013-09-03  7:16                                 ` Sedat Dilek
  2013-09-03  8:44                                 ` Vineet Gupta
  0 siblings, 2 replies; 30+ messages in thread
From: Manfred Spraul @ 2013-09-02 16:29 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

Hi,

[forgot to cc everyone, thus I'll summarize some mails...]
On 09/02/2013 06:58 AM, Vineet Gupta wrote:
> On 08/31/2013 11:20 PM, Linus Torvalds wrote:
>> Vineet, actual patch for what Davidlohr suggests attached. Can you try it?
>>
>>               Linus
> Apologies for late in getting back to this - I was away from my computer for a bit.
>
> Unfortunately, with a quick test, this patch doesn't help.
> FWIW, this is latest mainline (.config attached).
>
> Let me know what diagnostics I can add to help with this.

msgctl08 is a bulk message send/receive test. I had to look at it once 
before, then it was a broken hardware:
https://lkml.org/lkml/2008/6/12/365
This can be ruled out, because it works with 3.10.

msgctl08 uses pairs of threads: one thread does msgsnd(), the other one 
msgrcv().
There is no synchronization, i.e. the msgsnd() can race ahead until the 
kernel buffer is full and then a block with msgrcv() follows or it could 
be pairs of alternating msgsnd()/msgrcv() operations.
No special features are used: each pair of threads has it's own message 
queues, all messages have type=1.

Vineet ran strace - and just before the signal from killing msgctl08, 
there are only msgsnd()/msgrcv() calls.
Vineet:
a) could you run strace tomorrow again, with '-ttt' as an additional 
option? I don't see where exactly it hangs.
b) Could you check that it is not just a performance regression?
     Does ./msgctl08 1000 16 hang, too?

In ipc/msg.c, I haven't seen any obvious reason why it should hang.
The only race I spotted so far is this one:
>       for (;;) {
>                 struct msg_sender s;
>
>                 err = -EACCES;
>                 if (ipcperms(ns, &msq->q_perm, S_IWUGO))
>                         goto out_unlock1;
>
>                 err = security_msg_queue_msgsnd(msq, msg, msgflg);
>                 if (err)
>                         goto out_unlock1;
>
>                 if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
>                                 1 + msq->q_qnum <= msq->q_qbytes) {
>                         break;
>                 }
>
[snip]
>         if (!pipelined_send(msq, msg)) {
>                 /* no one is waiting for this message, enqueue it */
>                 list_add_tail(&msg->m_list, &msq->q_messages);
>                 msq->q_cbytes += msgsz;
>                 msq->q_qnum++;
>                 atomic_add(msgsz, &ns->msg_bytes);

The access to msq->q_cbytes is not protected. Thus two parallel msgsnd() 
calls could succeed, even if both together brings the queue length above 
the limit.
But it can't explain why 3.11-rc7 hangs: As explained above, msgctl08 
uses one queue for each thread pair.

--
     Manfred


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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-02 16:29                               ` Manfred Spraul
@ 2013-09-03  7:16                                 ` Sedat Dilek
  2013-09-03  7:34                                   ` Vineet Gupta
  2013-09-03  8:44                                 ` Vineet Gupta
  1 sibling, 1 reply; 30+ messages in thread
From: Sedat Dilek @ 2013-09-03  7:16 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Vineet Gupta, Linus Torvalds, Davidlohr Bueso, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On Mon, Sep 2, 2013 at 6:29 PM, Manfred Spraul <manfred@colorfullife.com> wrote:
> Hi,
>
> [forgot to cc everyone, thus I'll summarize some mails...]
>
> On 09/02/2013 06:58 AM, Vineet Gupta wrote:
>>
>> On 08/31/2013 11:20 PM, Linus Torvalds wrote:
>>>
>>> Vineet, actual patch for what Davidlohr suggests attached. Can you try
>>> it?
>>>
>>>               Linus
>>
>> Apologies for late in getting back to this - I was away from my computer
>> for a bit.
>>
>> Unfortunately, with a quick test, this patch doesn't help.
>> FWIW, this is latest mainline (.config attached).
>>
>> Let me know what diagnostics I can add to help with this.
>
>
> msgctl08 is a bulk message send/receive test. I had to look at it once
> before, then it was a broken hardware:
> https://lkml.org/lkml/2008/6/12/365
> This can be ruled out, because it works with 3.10.
>
> msgctl08 uses pairs of threads: one thread does msgsnd(), the other one
> msgrcv().
> There is no synchronization, i.e. the msgsnd() can race ahead until the
> kernel buffer is full and then a block with msgrcv() follows or it could be
> pairs of alternating msgsnd()/msgrcv() operations.
> No special features are used: each pair of threads has it's own message
> queues, all messages have type=1.
>
> Vineet ran strace - and just before the signal from killing msgctl08, there
> are only msgsnd()/msgrcv() calls.
> Vineet:
> a) could you run strace tomorrow again, with '-ttt' as an additional option?
> I don't see where exactly it hangs.
> b) Could you check that it is not just a performance regression?
>     Does ./msgctl08 1000 16 hang, too?
>
> In ipc/msg.c, I haven't seen any obvious reason why it should hang.
> The only race I spotted so far is this one:
>>
>>       for (;;) {
>>                 struct msg_sender s;
>>
>>                 err = -EACCES;
>>                 if (ipcperms(ns, &msq->q_perm, S_IWUGO))
>>                         goto out_unlock1;
>>
>>
>>                 err = security_msg_queue_msgsnd(msq, msg, msgflg);
>>                 if (err)
>>                         goto out_unlock1;
>>
>>                 if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
>>                                 1 + msq->q_qnum <= msq->q_qbytes) {
>>                         break;
>>                 }
>>
> [snip]
>>
>>         if (!pipelined_send(msq, msg)) {
>>                 /* no one is waiting for this message, enqueue it */
>>                 list_add_tail(&msg->m_list, &msq->q_messages);
>>                 msq->q_cbytes += msgsz;
>>                 msq->q_qnum++;
>>                 atomic_add(msgsz, &ns->msg_bytes);
>
>
> The access to msq->q_cbytes is not protected. Thus two parallel msgsnd()
> calls could succeed, even if both together brings the queue length above the
> limit.
> But it can't explain why 3.11-rc7 hangs: As explained above, msgctl08 uses
> one queue for each thread pair.
>

Just FYI:

Linux Testing Project (LTP) will do a new release in the 1st September week.
Some IPC test-suites were reworked.
Manfred can you look at them ("...msgctl08 uses one queue for each
thread pair.").
( Might be worth to throw some words at the LTP mailing-list (that
test-case is not ideal, etc.)? )

- Sedat -

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  7:16                                 ` Sedat Dilek
@ 2013-09-03  7:34                                   ` Vineet Gupta
       [not found]                                     ` <5225949C.9030201@colorfullife.com>
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-03  7:34 UTC (permalink / raw)
  To: sedat.dilek@gmail.com
  Cc: Manfred Spraul, Linus Torvalds, Davidlohr Bueso, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On 09/03/2013 12:46 PM, Sedat Dilek wrote:
> Just FYI:
>
> Linux Testing Project (LTP) will do a new release in the 1st September week.
> Some IPC test-suites were reworked.
> Manfred can you look at them ("...msgctl08 uses one queue for each
> thread pair.").
> ( Might be worth to throw some words at the LTP mailing-list (that
> test-case is not ideal, etc.)? )
>

Well we had a userspace test working before (3.10) and now it won't. In Linux
world that is not something we do in general - although there could be exceptions
because the test is not idea etc - anyways not my call !

However assuming we are going ahead with debugging this - can you please confirm
whether you see the issue on x86 as well as I have not tested that ? I vaguely
remember one of your earlier posts suggested you did

Thx,
-Vineet



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

* Re: ipc-msg broken again on 3.11-rc7?
       [not found]                                     ` <5225949C.9030201@colorfullife.com>
@ 2013-09-03  8:43                                       ` Sedat Dilek
  0 siblings, 0 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-09-03  8:43 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Vineet Gupta, Linus Torvalds, Davidlohr Bueso, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On Tue, Sep 3, 2013 at 9:49 AM, Manfred Spraul <manfred@colorfullife.com> wrote:
> Hi Vineet,
>
>
> On 09/03/2013 09:34 AM, Vineet Gupta wrote:
>
> However assuming we are going ahead with debugging this - can you please
> confirm whether you see the issue on x86 as well as I have not tested that ?
> I vaguely remember one of your earlier posts suggested you did Thx, -Vineet
>
> I'm unable to reproduce the issue so far. I ran
> - something like 4000 stock msgctl08 with 4 cores on x86.
> - a few runs with modified msgctl08 with either slowed down reader or slowed
> down writer threads. (i.e.: force queue full or queue empty waits).
> - a few runs (modified&unmodified) with all but one core taken offline.
>

Cool.
Manfred, can you offer your modified test-cases, please?
Thanks in advance.

- Sedat -

> I have not yet tested with PREEMPT enabled.
>
> A few more ideas:
> - what is the output of ipcs -q? Are the queues empty or full?
> - what is the output of then WCHAN field with ps when it hangs?
> Something like
>  #ps -o pid,f,stat,pcpu,pmem,psr,wchan=WIDE-WCHAN -o comm,args
>
> --
>     Manfred

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-02 16:29                               ` Manfred Spraul
  2013-09-03  7:16                                 ` Sedat Dilek
@ 2013-09-03  8:44                                 ` Vineet Gupta
  2013-09-03  8:57                                   ` Manfred Spraul
  1 sibling, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-03  8:44 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On 09/02/2013 09:59 PM, Manfred Spraul wrote:
> Hi,
>
> [forgot to cc everyone, thus I'll summarize some mails...]
> On 09/02/2013 06:58 AM, Vineet Gupta wrote:
>> On 08/31/2013 11:20 PM, Linus Torvalds wrote:
>>> Vineet, actual patch for what Davidlohr suggests attached. Can you try it?
>>>
>>>               Linus
>> Apologies for late in getting back to this - I was away from my computer for a bit.
>>
>> Unfortunately, with a quick test, this patch doesn't help.
>> FWIW, this is latest mainline (.config attached).
>>
>> Let me know what diagnostics I can add to help with this.
> msgctl08 is a bulk message send/receive test. I had to look at it once 
> before, then it was a broken hardware:
> https://lkml.org/lkml/2008/6/12/365
> This can be ruled out, because it works with 3.10.
>
> msgctl08 uses pairs of threads: one thread does msgsnd(), the other one 
> msgrcv().
> There is no synchronization, i.e. the msgsnd() can race ahead until the 
> kernel buffer is full and then a block with msgrcv() follows or it could 
> be pairs of alternating msgsnd()/msgrcv() operations.
> No special features are used: each pair of threads has it's own message 
> queues, all messages have type=1.
>
> Vineet ran strace - and just before the signal from killing msgctl08, 
> there are only msgsnd()/msgrcv() calls.
> Vineet:
> a) could you run strace tomorrow again, with '-ttt' as an additional 
> option? I don't see where exactly it hangs.

Yet to do this.

> b) Could you check that it is not just a performance regression?
>      Does ./msgctl08 1000 16 hang, too?

Nope that doesn't hang. The minimal configuration that hangs reliably is msgctl
50000 2

With this config there are 3 processes.
...
  555   554 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
  554   551 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
  551   496 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
...

[ARCLinux]$ cat /proc/551/stack
[<80aec3c6>] do_wait+0xa02/0xc94
[<80aecad2>] SyS_wait4+0x52/0xa4
[<80ae24fc>] ret_from_system_call+0x0/0x4

[ARCLinux]$ cat /proc/555/stack
[<80c2950e>] SyS_msgrcv+0x252/0x420
[<80ae24fc>] ret_from_system_call+0x0/0x4

[ARCLinux]$ cat /proc/554/stack
[<80c28c82>] do_msgsnd+0x116/0x35c
[<80ae24fc>] ret_from_system_call+0x0/0x4

Is this a case of lost wakeup or some such. I'm running with some more diagnostics
and will report soon ...

-Vineet

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  8:44                                 ` Vineet Gupta
@ 2013-09-03  8:57                                   ` Manfred Spraul
  2013-09-03  9:16                                     ` Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Manfred Spraul @ 2013-09-03  8:57 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On 09/03/2013 10:44 AM, Vineet Gupta wrote:
>> b) Could you check that it is not just a performance regression?
>>       Does ./msgctl08 1000 16 hang, too?
> Nope that doesn't hang. The minimal configuration that hangs reliably is msgctl
> 50000 2
>
> With this config there are 3 processes.
> ...
>    555   554 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>    554   551 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>    551   496 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
> ...
>
> [ARCLinux]$ cat /proc/551/stack
> [<80aec3c6>] do_wait+0xa02/0xc94
> [<80aecad2>] SyS_wait4+0x52/0xa4
> [<80ae24fc>] ret_from_system_call+0x0/0x4
>
> [ARCLinux]$ cat /proc/555/stack
> [<80c2950e>] SyS_msgrcv+0x252/0x420
> [<80ae24fc>] ret_from_system_call+0x0/0x4
>
> [ARCLinux]$ cat /proc/554/stack
> [<80c28c82>] do_msgsnd+0x116/0x35c
> [<80ae24fc>] ret_from_system_call+0x0/0x4
>
> Is this a case of lost wakeup or some such. I'm running with some more diagnostics
> and will report soon ...
What is the output of ipcs -q? Is the queue full or empty when it hangs?
I.e. do we forget to wake up a receiver or forget to wake up a sender?

--
     Manfred

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  8:57                                   ` Manfred Spraul
@ 2013-09-03  9:16                                     ` Vineet Gupta
  2013-09-03  9:23                                       ` Manfred Spraul
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-03  9:16 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Vineet Gupta, Linus Torvalds, Davidlohr Bueso, Sedat Dilek,
	Davidlohr Bueso, linux-next, LKML, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel,
	Jonathan Gonzalez

On 09/03/2013 02:27 PM, Manfred Spraul wrote:
> On 09/03/2013 10:44 AM, Vineet Gupta wrote:
>>> b) Could you check that it is not just a performance regression?
>>>       Does ./msgctl08 1000 16 hang, too?
>> Nope that doesn't hang. The minimal configuration that hangs reliably is msgctl
>> 50000 2
>>
>> With this config there are 3 processes.
>> ...
>>    555   554 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>    554   551 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>    551   496 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>> ...
>>
>> [ARCLinux]$ cat /proc/551/stack
>> [<80aec3c6>] do_wait+0xa02/0xc94
>> [<80aecad2>] SyS_wait4+0x52/0xa4
>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>
>> [ARCLinux]$ cat /proc/555/stack
>> [<80c2950e>] SyS_msgrcv+0x252/0x420
>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>
>> [ARCLinux]$ cat /proc/554/stack
>> [<80c28c82>] do_msgsnd+0x116/0x35c
>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>
>> Is this a case of lost wakeup or some such. I'm running with some more diagnostics
>> and will report soon ...
> What is the output of ipcs -q? Is the queue full or empty when it hangs?
> I.e. do we forget to wake up a receiver or forget to wake up a sender?
/ # ipcs -q

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages   
0x72d83160 163841     root       600        0            0      



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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  9:16                                     ` Vineet Gupta
@ 2013-09-03  9:23                                       ` Manfred Spraul
  2013-09-03  9:51                                         ` Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Manfred Spraul @ 2013-09-03  9:23 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On 09/03/2013 11:16 AM, Vineet Gupta wrote:
> On 09/03/2013 02:27 PM, Manfred Spraul wrote:
>> On 09/03/2013 10:44 AM, Vineet Gupta wrote:
>>>> b) Could you check that it is not just a performance regression?
>>>>        Does ./msgctl08 1000 16 hang, too?
>>> Nope that doesn't hang. The minimal configuration that hangs reliably is msgctl
>>> 50000 2
>>>
>>> With this config there are 3 processes.
>>> ...
>>>     555   554 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>>     554   551 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>>     551   496 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>> ...
>>>
>>> [ARCLinux]$ cat /proc/551/stack
>>> [<80aec3c6>] do_wait+0xa02/0xc94
>>> [<80aecad2>] SyS_wait4+0x52/0xa4
>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>
>>> [ARCLinux]$ cat /proc/555/stack
>>> [<80c2950e>] SyS_msgrcv+0x252/0x420
>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>
>>> [ARCLinux]$ cat /proc/554/stack
>>> [<80c28c82>] do_msgsnd+0x116/0x35c
>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>
>>> Is this a case of lost wakeup or some such. I'm running with some more diagnostics
>>> and will report soon ...
>> What is the output of ipcs -q? Is the queue full or empty when it hangs?
>> I.e. do we forget to wake up a receiver or forget to wake up a sender?
> / # ipcs -q
>
> ------ Message Queues --------
> key        msqid      owner      perms      used-bytes   messages
> 0x72d83160 163841     root       600        0            0
>
>
Ok, a sender is sleeping - even though there are no messages in the queue.
Perhaps it is the race that I mentioned in a previous mail:
>       for (;;) {
>                 struct msg_sender s;
>
>                 err = -EACCES;
>                 if (ipcperms(ns, &msq->q_perm, S_IWUGO))
>                         goto out_unlock1;
>
>                 err = security_msg_queue_msgsnd(msq, msg, msgflg);
>                 if (err)
>                         goto out_unlock1;
>
>                 if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
>                                 1 + msq->q_qnum <= msq->q_qbytes) {
>                         break;
>                 }
>
[snip]
>         if (!pipelined_send(msq, msg)) {
>                 /* no one is waiting for this message, enqueue it */
>                 list_add_tail(&msg->m_list, &msq->q_messages);
>                 msq->q_cbytes += msgsz;
>                 msq->q_qnum++;
>                 atomic_add(msgsz, &ns->msg_bytes);

The access to msq->q_cbytes is not protected.

Vineet, could you try to move the test for free space after ipc_lock?
I.e. the lock must not get dropped between testing for free space and 
enqueueing the messages.

--
     Manfred

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  9:23                                       ` Manfred Spraul
@ 2013-09-03  9:51                                         ` Vineet Gupta
  2013-09-03 10:16                                           ` Manfred Spraul
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-03  9:51 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Vineet Gupta, Linus Torvalds, Davidlohr Bueso, Sedat Dilek,
	Davidlohr Bueso, linux-next, LKML, Stephen Rothwell,
	Andrew Morton, linux-mm, Andi Kleen, Rik van Riel,
	Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 3058 bytes --]

On 09/03/2013 02:53 PM, Manfred Spraul wrote:
> On 09/03/2013 11:16 AM, Vineet Gupta wrote:
>> On 09/03/2013 02:27 PM, Manfred Spraul wrote:
>>> On 09/03/2013 10:44 AM, Vineet Gupta wrote:
>>>>> b) Could you check that it is not just a performance regression?
>>>>>        Does ./msgctl08 1000 16 hang, too?
>>>> Nope that doesn't hang. The minimal configuration that hangs reliably is msgctl
>>>> 50000 2
>>>>
>>>> With this config there are 3 processes.
>>>> ...
>>>>     555   554 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>>>     554   551 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>>>     551   496 root     S     1208  0.4   0  0.0 ./msgctl08 50000 2
>>>> ...
>>>>
>>>> [ARCLinux]$ cat /proc/551/stack
>>>> [<80aec3c6>] do_wait+0xa02/0xc94
>>>> [<80aecad2>] SyS_wait4+0x52/0xa4
>>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>>
>>>> [ARCLinux]$ cat /proc/555/stack
>>>> [<80c2950e>] SyS_msgrcv+0x252/0x420
>>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>>
>>>> [ARCLinux]$ cat /proc/554/stack
>>>> [<80c28c82>] do_msgsnd+0x116/0x35c
>>>> [<80ae24fc>] ret_from_system_call+0x0/0x4
>>>>
>>>> Is this a case of lost wakeup or some such. I'm running with some more diagnostics
>>>> and will report soon ...
>>> What is the output of ipcs -q? Is the queue full or empty when it hangs?
>>> I.e. do we forget to wake up a receiver or forget to wake up a sender?
>> / # ipcs -q
>>
>> ------ Message Queues --------
>> key        msqid      owner      perms      used-bytes   messages
>> 0x72d83160 163841     root       600        0            0
>>
>>
> Ok, a sender is sleeping - even though there are no messages in the queue.
> Perhaps it is the race that I mentioned in a previous mail:
>>       for (;;) {
>>                 struct msg_sender s;
>>
>>                 err = -EACCES;
>>                 if (ipcperms(ns, &msq->q_perm, S_IWUGO))
>>                         goto out_unlock1;
>>
>>                 err = security_msg_queue_msgsnd(msq, msg, msgflg);
>>                 if (err)
>>                         goto out_unlock1;
>>
>>                 if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
>>                                 1 + msq->q_qnum <= msq->q_qbytes) {
>>                         break;
>>                 }
>>
> [snip]
>>         if (!pipelined_send(msq, msg)) {
>>                 /* no one is waiting for this message, enqueue it */
>>                 list_add_tail(&msg->m_list, &msq->q_messages);
>>                 msq->q_cbytes += msgsz;
>>                 msq->q_qnum++;
>>                 atomic_add(msgsz, &ns->msg_bytes);
> The access to msq->q_cbytes is not protected.
>
> Vineet, could you try to move the test for free space after ipc_lock?
> I.e. the lock must not get dropped between testing for free space and 
> enqueueing the messages.

Hmm, the code movement is not trivial. I broke even the simplest of cases (patch
attached). This includes the additional change which Linus/Davidlohr had asked for.

-Vineet


[-- Attachment #2: patch-ipc-2 --]
[-- Type: text/plain, Size: 1075 bytes --]

diff --git a/ipc/msg.c b/ipc/msg.c
index 9f29d9e..a512829 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -687,14 +687,6 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		if (ipcperms(ns, &msq->q_perm, S_IWUGO))
 			goto out_unlock1;
 
-		err = security_msg_queue_msgsnd(msq, msg, msgflg);
-		if (err)
-			goto out_unlock1;
-
-		if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
-				1 + msq->q_qnum <= msq->q_qbytes) {
-			break;
-		}
 
 		/* queue full, wait: */
 		if (msgflg & IPC_NOWAIT) {
@@ -703,6 +695,10 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		}
 
 		ipc_lock_object(&msq->q_perm);
+		err = security_msg_queue_msgsnd(msq, msg, msgflg);
+		if (err)
+			goto out_unlock0;
+
 		ss_add(msq, &s);
 
 		if (!ipc_rcu_getref(msq)) {
@@ -734,6 +730,12 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 	}
 
 	ipc_lock_object(&msq->q_perm);
+
+	if (!(msgsz + msq->q_cbytes <= msq->q_qbytes &&
+			1 + msq->q_qnum <= msq->q_qbytes)) {
+		goto out_unlock0;
+	}
+
 	msq->q_lspid = task_tgid_vnr(current);
 	msq->q_stime = get_seconds();
 

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

* Re: ipc-msg broken again on 3.11-rc7?
  2013-09-03  9:51                                         ` Vineet Gupta
@ 2013-09-03 10:16                                           ` Manfred Spraul
  2013-09-03 10:32                                             ` ipc msg now works (was Re: ipc-msg broken again on 3.11-rc7?) Vineet Gupta
  0 siblings, 1 reply; 30+ messages in thread
From: Manfred Spraul @ 2013-09-03 10:16 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

[-- Attachment #1: Type: text/plain, Size: 569 bytes --]

Hi Vineet,

On 09/03/2013 11:51 AM, Vineet Gupta wrote:
> On 09/03/2013 02:53 PM, Manfred Spraul wrote:
>>
>> The access to msq->q_cbytes is not protected.
>>
>> Vineet, could you try to move the test for free space after ipc_lock?
>> I.e. the lock must not get dropped between testing for free space and
>> enqueueing the messages.
> Hmm, the code movement is not trivial. I broke even the simplest of cases (patch
> attached). This includes the additional change which Linus/Davidlohr had asked for.
The attached patch should work. Could you try it?

--
     Manfred

[-- Attachment #2: patch-ipcmsg-wip --]
[-- Type: text/plain, Size: 1139 bytes --]

diff --git a/ipc/msg.c b/ipc/msg.c
index 9f29d9e..b65fdf1 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -680,16 +680,18 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		goto out_unlock1;
 	}
 
+	ipc_lock_object(&msq->q_perm);
+
 	for (;;) {
 		struct msg_sender s;
 
 		err = -EACCES;
 		if (ipcperms(ns, &msq->q_perm, S_IWUGO))
-			goto out_unlock1;
+			goto out_unlock0;
 
 		err = security_msg_queue_msgsnd(msq, msg, msgflg);
 		if (err)
-			goto out_unlock1;
+			goto out_unlock0;
 
 		if (msgsz + msq->q_cbytes <= msq->q_qbytes &&
 				1 + msq->q_qnum <= msq->q_qbytes) {
@@ -699,10 +701,9 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 		/* queue full, wait: */
 		if (msgflg & IPC_NOWAIT) {
 			err = -EAGAIN;
-			goto out_unlock1;
+			goto out_unlock0;
 		}
 
-		ipc_lock_object(&msq->q_perm);
 		ss_add(msq, &s);
 
 		if (!ipc_rcu_getref(msq)) {
@@ -730,10 +731,7 @@ long do_msgsnd(int msqid, long mtype, void __user *mtext,
 			goto out_unlock0;
 		}
 
-		ipc_unlock_object(&msq->q_perm);
 	}
-
-	ipc_lock_object(&msq->q_perm);
 	msq->q_lspid = task_tgid_vnr(current);
 	msq->q_stime = get_seconds();
 

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

* ipc msg now works (was Re: ipc-msg broken again on 3.11-rc7?)
  2013-09-03 10:16                                           ` Manfred Spraul
@ 2013-09-03 10:32                                             ` Vineet Gupta
  2013-09-03 22:46                                               ` Sedat Dilek
  0 siblings, 1 reply; 30+ messages in thread
From: Vineet Gupta @ 2013-09-03 10:32 UTC (permalink / raw)
  To: Manfred Spraul
  Cc: Linus Torvalds, Davidlohr Bueso, Sedat Dilek, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On 09/03/2013 03:47 PM, Manfred Spraul wrote:
> Hi Vineet,
>
> On 09/03/2013 11:51 AM, Vineet Gupta wrote:
>> On 09/03/2013 02:53 PM, Manfred Spraul wrote:
>>> The access to msq->q_cbytes is not protected.
>>>
>>> Vineet, could you try to move the test for free space after ipc_lock?
>>> I.e. the lock must not get dropped between testing for free space and
>>> enqueueing the messages.
>> Hmm, the code movement is not trivial. I broke even the simplest of cases (patch
>> attached). This includes the additional change which Linus/Davidlohr had asked for.
> The attached patch should work. Could you try it?
>

Yes this did the trick, now the default config of 100k iterations + 16 processes
runs to completion.

Thx,
-Vineet

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

* Re: ipc msg now works (was Re: ipc-msg broken again on 3.11-rc7?)
  2013-09-03 10:32                                             ` ipc msg now works (was Re: ipc-msg broken again on 3.11-rc7?) Vineet Gupta
@ 2013-09-03 22:46                                               ` Sedat Dilek
  0 siblings, 0 replies; 30+ messages in thread
From: Sedat Dilek @ 2013-09-03 22:46 UTC (permalink / raw)
  To: Vineet Gupta
  Cc: Manfred Spraul, Linus Torvalds, Davidlohr Bueso, Davidlohr Bueso,
	linux-next, LKML, Stephen Rothwell, Andrew Morton, linux-mm,
	Andi Kleen, Rik van Riel, Jonathan Gonzalez

On Tue, Sep 3, 2013 at 12:32 PM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
> On 09/03/2013 03:47 PM, Manfred Spraul wrote:
>> Hi Vineet,
>>
>> On 09/03/2013 11:51 AM, Vineet Gupta wrote:
>>> On 09/03/2013 02:53 PM, Manfred Spraul wrote:
>>>> The access to msq->q_cbytes is not protected.
>>>>
>>>> Vineet, could you try to move the test for free space after ipc_lock?
>>>> I.e. the lock must not get dropped between testing for free space and
>>>> enqueueing the messages.
>>> Hmm, the code movement is not trivial. I broke even the simplest of cases (patch
>>> attached). This includes the additional change which Linus/Davidlohr had asked for.
>> The attached patch should work. Could you try it?
>>
>
> Yes this did the trick, now the default config of 100k iterations + 16 processes
> runs to completion.
>

Manfred's patch "ipc/msg.c: Fix lost wakeup in msgsnd()." is now upstream.

- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=bebcb928c820d0ee83aca4b192adc195e43e66a2

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

end of thread, other threads:[~2013-09-03 22:46 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-21 19:34 linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ] Sedat Dilek
2013-06-21 22:07 ` Davidlohr Bueso
2013-06-21 22:54   ` Sedat Dilek
2013-06-21 23:11     ` Davidlohr Bueso
2013-06-21 23:14       ` Sedat Dilek
2013-06-21 23:15     ` Sedat Dilek
     [not found] ` <CA+icZUVbUD1tUa_ORtn_ZZebpp3gXXHGAcNe0NdYPXPMPoABuA@mail.gmail.com>
2013-06-25 20:33   ` Davidlohr Bueso
     [not found]     ` <CA+icZUXgOd=URJBH5MGAZKdvdkMpFt+5mRxtzuDzq_vFHpoc2A@mail.gmail.com>
2013-06-25 23:29       ` Davidlohr Bueso
2013-08-28 11:58         ` ipc-msg broken again on 3.11-rc7? (was Re: linux-next: Tree for Jun 21 [ BROKEN ipc/ipc-msg ]) Vineet Gupta
2013-08-29  3:04           ` Sedat Dilek
2013-08-29  7:21             ` Vineet Gupta
2013-08-29  7:52               ` Sedat Dilek
2013-08-30  8:19                 ` Vineet Gupta
2013-08-30  8:27                   ` Sedat Dilek
2013-08-30  8:46                     ` ipc-msg broken again on 3.11-rc7? Vineet Gupta
     [not found]                       ` <CALE5RAvaa4bb-9xAnBe07Yp2n+Nn4uGEgqpLrKMuOE8hhZv00Q@mail.gmail.com>
2013-08-30 16:31                         ` Davidlohr Bueso
2013-08-31 17:50                           ` Linus Torvalds
2013-09-02  4:58                             ` Vineet Gupta
2013-09-02 16:29                               ` Manfred Spraul
2013-09-03  7:16                                 ` Sedat Dilek
2013-09-03  7:34                                   ` Vineet Gupta
     [not found]                                     ` <5225949C.9030201@colorfullife.com>
2013-09-03  8:43                                       ` Sedat Dilek
2013-09-03  8:44                                 ` Vineet Gupta
2013-09-03  8:57                                   ` Manfred Spraul
2013-09-03  9:16                                     ` Vineet Gupta
2013-09-03  9:23                                       ` Manfred Spraul
2013-09-03  9:51                                         ` Vineet Gupta
2013-09-03 10:16                                           ` Manfred Spraul
2013-09-03 10:32                                             ` ipc msg now works (was Re: ipc-msg broken again on 3.11-rc7?) Vineet Gupta
2013-09-03 22:46                                               ` Sedat Dilek

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