Re: Removing swap lockmap...

Andrea Arcangeli (andrea@e-mind.com)
Tue, 19 Jan 1999 19:15:51 +0100 (CET)


On 19 Jan 1999, Zlatko Calusic wrote:

> Yes, this case probably doesn't get enough testing with my current
> setup, so it is quite hard (for me) to prove removing lockmap is
> no-no. Problem is that I don't understand shm swapping very well

Launch some time this proggy to try out shm swapping:

/*
* Copyright (C) 1999 Andrea Arcangeli
* shm swapout test
*/

#include <sys/ipc.h>
#include <sys/shm.h>

#define SIZE 16000000

main()
{
int shmid;
char *addr, *p;
if ((shmid = shmget(IPC_PRIVATE, SIZE, IPC_CREAT | 0644)) < 0)
perror("shmget");
if ((addr = shmat(shmid, NULL, 0)) < 0)
perror("shmat");
for (p = addr; p < addr + SIZE; p+=4096)
*p = 0;
}

To know if the lockmap is needed you can also reinsert the code and add a
printk() in the test_and_set_bit() path.

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/