Re: kmap!

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

 



On Mon, 1 Nov 2004 02:42:03 -0800 (PST), prasanna wakhare
<prasannawakhare@xxxxxxxxx> wrote:

> The readpage of all Filesystem has got code like
>  if (inode->i_size <= ((obd_off)page->index) <<
> PAGE_SHIFT) {
>                 CERROR("reading beyond EOF\n");
>                 memset(kmap(page), 0, PAGE_SIZE);
>                 kunmap(page);
>                 SetPageUptodate(page);
>                 GOTO(out, rc = 0);
>         }

> Please somebody give me reason why this kmap when we
> have to kunmap it in next line.

The page might be in high memory outside of the directly mapped kernel
memory and so it is first mapped before memset is called. It's
subsequently unmapped since the kernel doesn't need a linear address
for it immediately and there is a limit on the number of possible
mappings which encourages them to have a brief existence.

Jon.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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