public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Ingo Molnar <mingo@elte.hu>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] O(1) proc_pid_readdir
Date: Mon, 17 Mar 2003 19:17:08 +0100	[thread overview]
Message-ID: <3E761124.8060402@colorfullife.com> (raw)
In-Reply-To: <20030317070334.GO20188@holomorphy.com>

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

William Lee Irwin III wrote:

>The NMI oopses are mostly decoded by hand b/c in-kernel (and other)
>backtrace decoders can't do it automatically. I might have to generate
>some fresh data, with some kind of hack (e.g. hand-coded NMI-based kind
>of smp_call_function) to trace the culprit and not just the victim.
>The victims were usually stuck in fork() or exit().
>
Could you check if the attached test app triggers the NMI oopser?

--
    Manfred

[-- Attachment #2: numados.cpp --]
[-- Type: text/plain, Size: 2175 bytes --]

/*
 * numados: stress test the tasklist lock.
 *
 * Copyright (C) 1999, 2001, 2003 by Manfred Spraul.
 *	All rights reserved except the rights granted by the GPL.
 *
 * Redistribution of this file is permitted under the terms of the GNU 
 * General Public License (GPL) version 2 or later.
 * $Header: /pub/home/manfred/cvs-tree/getdents/getdents.cpp,v 1.1 2003/03/16 21:07:43 manfred Exp $
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <linux/types.h>
#include <linux/dirent.h>
#include <linux/unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

#define BUFSZ	4096
unsigned char entries[BUFSZ];

#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \
{ \
long __res; \
__asm__ volatile ("int $0x80" \
	: "=a" (__res) \
	: "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \
		  "d" ((long)(arg3))); \
__syscall_return(type,__res); \
}

_syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count);

static void poll_tasklist(void) 
{
	int fd, retval;

	for (;;) {
		fd = open("/proc",O_RDONLY);
		if (fd < 0) {
			printf("open failed, errno %d.\n", errno);
			exit(4);
		}
		lseek(fd, 1000000, SEEK_SET);
		retval = getdents(fd, (struct dirent *)entries, BUFSZ);
		close(fd);
	}
}

int main(int argc, char **argv)
{
	int retval;
	int forks, readers;
	int i;
	printf("numados <forks> <readers>\n");
	if (argc != 3)
		return 1;

	forks=atoi(argv[1]);
	readers=atoi(argv[2]);
	printf("Forks: %d.\n", forks);
	for (i=0;i<forks;i++) {
		retval = fork();
		if (retval < 0) {
			printf("fork failed for process %d, errno %d.\n", i+1, errno);
			return 2;
		} else if (retval == 0) {
			for (;;) sleep(1000);
		} else {
			printf(" child %d: pid %d created\n", i, retval);
			fflush(stdout);
		}
	}
	printf("%d child processes created.\n", i);

	for (i=0;i<readers;i++) {
		retval = fork();
		if (retval < 0) {
			printf("fork failed for process %d, errno %d.\n", i+1, errno);
			return 3;
		} else if (retval == 0) {
			poll_tasklist();
			for (;;) sleep(10000);
		}
	}
	printf("%d reader processes created.\n", i);
	for(;;) sleep(1000);
}

  reply	other threads:[~2003-03-17 18:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-16 15:52 [RFC] O(1) proc_pid_readdir Manfred Spraul
2003-03-16 20:10 ` William Lee Irwin III
2003-03-16 21:05 ` Ingo Molnar
2003-03-16 21:24   ` Manfred Spraul
2003-03-16 21:35     ` William Lee Irwin III
2003-03-16 21:45       ` Manfred Spraul
2003-03-17  6:22       ` Ingo Molnar
2003-03-17  7:03         ` William Lee Irwin III
2003-03-17 18:17           ` Manfred Spraul [this message]
2003-03-18  0:14             ` William Lee Irwin III
2003-03-18  0:48               ` William Lee Irwin III
2003-03-18  1:22                 ` William Lee Irwin III
2003-03-18  9:25             ` William Lee Irwin III
2003-03-17  6:19     ` Ingo Molnar
2003-03-22 16:02   ` Manfred Spraul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E761124.8060402@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox