RE: [PATCH 1/4] [OMAPZOOM] [UPDATE] DSPBRIDGE: Memory lock for DMM.

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

 



Ameya,

> 
> get_page() function has following check inside it:
> VM_BUG_ON(atomic_read(&page->_count) == 0);
> 
> Why we need to repeat it again?
> I guess we can completely remove following check which is in my
> opinion completely
> redundant:

-- This check in get_page is conditional check and this is to catch the cases when page count starts with "0", which I think is still a possible condition if the user space buffer was never touched. So I am not sure if we can rely on this.

> 
> if (page_count(pg) < 1) {
> }

-- This is to just to extend the check for the bad Page count.

Thank you,
Best regards,
Hari

> -----Original Message-----
> From: Ameya Palande [mailto:2ameya@xxxxxxxxx]
> Sent: Tuesday, April 07, 2009 3:49 PM
> To: Kanigeri, Hari
> Cc: Guzman Lugo, Fernando; Pandita, Vikram; linux-omap@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH 1/4] [OMAPZOOM] [UPDATE] DSPBRIDGE: Memory lock for
> DMM.
> 
> Hi Hari,
> 
> On Tue, Apr 7, 2009 at 11:27 PM, Kanigeri, Hari <h-kanigeri2@xxxxxx>
> wrote:
> > Ameya,
> >
> >> If this is the case then what is the point of having following code?
> >> if (page_count(pg) < 1)  <-- This will always evaluate to FALSE.
> >
> > -- As you mentioned this case shouldn't be hit. This check is to only to
> ensure that the >translations from user space VA to Physical address is
> taking place correctly and flag the >user if something went bad.
> 
> get_page() function has following check inside it:
> VM_BUG_ON(atomic_read(&page->_count) == 0);
> 
> Why we need to repeat it again?
> I guess we can completely remove following check which is in my
> opinion completely
> redundant:
> 
> if (page_count(pg) < 1) {
> }
> 
> Cheers,
> Ameya.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux