Why is current->mm==0 ?

Karsten Muehlmann (muehlman@mp-sun1.informatik.uni-mannheim.de)
Fri, 22 Oct 1999 17:01:10 +0200


Hello!

I have a problem with a driver (module) that has to do large DMA
transfers via the PCI bus. The PCI bridge we use is capable of
scatter-gather transfers, so the pages don't have to be consecutive.
What the driver does is the following:

- Allocate a buffer with vmalloc,
- lock the pages,
- build a scatter-gather list for the PCI bridge,
- remap the pages into the current processes' address space and
- do the DMA transfer.

The procedure is quite as described in "Linux device drivers" from A.
Rubini (Chap. 13, "Remapping Virtual Addresses").

The driver works well with the kernels 2.2.5 and 2.2.7 on other machines
(SMP too), but not on mine:
- Gigabyte GA686-DLX mainboard with 512MB memory and dual 300MHz PII
- kernels 2.2.5 and 2.2.13 without any patches tested

The problem occurs, when we try to get the physical addresses of the
buffer pages. The "mm" field of _all_ task_structs is zero, which gives
an oops in pgd_offset. =:-/ My testroutine:

for(p=current;(p=p->next_task) != current;)
printk("<0> p=%x p->pid=%x p->mm=%x\n",p,p->pid,p->mm);

A sample output:

Oct 22 15:22:15 mp-pc19 kernel: p=80226000 p->pid=0 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8fff2000 p->pid=1 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8ffe4000 p->pid=2 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8ffe2000 p->pid=3 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8ffe0000 p->pid=4 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8ffde000 p->pid=5 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8d8c6000 p->pid=6b p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8d874000 p->pid=6f p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8d7fa000 p->pid=7d p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8ff6e000 p->pid=89 p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8fc7e000 p->pid=8a p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8fc64000 p->pid=8b p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8fdb8000 p->pid=8c p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8fcf6000 p->pid=8d p->mm=0
Oct 22 15:22:15 mp-pc19 kernel: p=8d91c000 p->pid=8e p->mm=0

Any ideas? What's it that I overlooked?

Thanks in advance,

Karsten

-
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/