Re: Getting virtual address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18-11-07 20:08, Talib Alim wrote:

I am writing sendpage (this is called when sendfile system call is
used) function for my protocol. User application calls with socket and
filename, kernel maps file and pass struct page * to sendpage function.

I use following expression to get virtual address and copy data

virtual_address = phys_to_virt(page_to_pfn(page) << PAGE_SHIFT);

This works fine on Pentium III machine with 515324 KB memory, but when
I run same code on Xeon with 2074604 KB memory, I get

Unable to handle kernel paging request at virtual address 3ab6c000

Is this because this address (struct page *) is not mapped ? how do I
check in my code whether it is mapped or not, since it is mapped on
Pentium.

Your virtual_address= only works for lowmem, the permanently and 1:1 mapped portion of physical memory. With the standard 3:1 user/kernel split, there's room for at most 896M of that. Your P3 will therefore have all its 512M as lowmem, but the 2G Xeon will (probably I should say, check your dmesg) be using most of it as highmem.

You should look into kmap{,_atomic}() to map highmem.

Rene.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux