Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756843Ab3C2T0r (ORCPT ); Fri, 29 Mar 2013 15:26:47 -0400 Received: from mail-ve0-f172.google.com ([209.85.128.172]:38670 "EHLO mail-ve0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756599Ab3C2T0q (ORCPT ); Fri, 29 Mar 2013 15:26:46 -0400 MIME-Version: 1.0 In-Reply-To: <20130329190642.GC23893@redhat.com> References: <1363809337-29718-1-git-send-email-riel@surriel.com> <20130321141058.76e028e492f98f6ee6e60353@linux-foundation.org> <20130326192852.GA25899@redhat.com> <20130326124309.077e21a9f59aaa3f3355e09b@linux-foundation.org> <20130329161746.GA8391@redhat.com> <20130329190642.GC23893@redhat.com> Date: Fri, 29 Mar 2013 12:26:45 -0700 X-Google-Sender-Auth: Wn9MrUwBS8vIGCEoLXpg3JpcDZg Message-ID: Subject: Re: ipc,sem: sysv semaphore scalability From: Linus Torvalds To: Dave Jones , Linus Torvalds , Andrew Morton , Rik van Riel , Davidlohr Bueso , Linux Kernel Mailing List , hhuang@redhat.com, "Low, Jason" , Michel Lespinasse , Larry Woodman , "Vinod, Chegu" , Peter Hurley , Stanislav Kinsbursky Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1512 Lines: 47 On Fri, Mar 29, 2013 at 12:06 PM, Dave Jones wrote: > > Here's an oops I just hit.. > > BUG: unable to handle kernel NULL pointer dereference at 000000000000000f > IP: [] testmsg.isra.5+0x1a/0x60 Btw, looking at the code leading up to this, what the f*ck is wrong with the IPC stuff? It's using the generic list stuff for most of the lists, but then it open-codes the accesses. So instead of using for_each_entry(walk_msg, &msq->q_messages, m_list) { .. } the ipc/msg.c code does all that by hand, with tmp = msq->q_messages.next; while (tmp != &msq->q_messages) { struct msg_msg *walk_msg; walk_msg = list_entry(tmp, struct msg_msg, m_list); ... tmp = tmp->next; } Ugh. The code is near unreadable. And then it has magic memory barriers etc, implying that it doesn't lock the data structures, but no comments about them. See expunge_all() and pipelined_send(). The code seems entirely random, and it's badly set up (annoyance of the day: crazy helper functions in ipc/msgutil.c to make sure that (a) you have to spend more effort looking for them, and (b) they won't get inlined). Clearly nobody has cared for the crazy IPC message code in a long time. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/