Hi Fernando, On Tue, Apr 7, 2009 at 10:26 PM, Guzman Lugo, Fernando <x0095840@xxxxxx> wrote:>> Hi,>> Patch updated wit the fix in page_count(pg).>>> From a5ab7e038b72e62358279ef3c4e64b2f260ceeee Mon Sep 17 00:00:00 2001> From: Hari Kanigeri <h-kanigeri2@xxxxxx>> Date: Thu, 26 Mar 2009 15:47:50 -0500> Subject: [PATCH] DSPBRIDGE: Memory lock for DMM.>> Lock down the pages that are mapped to DSP virtual memory to prevent from> getting swapped out>> Signed-off-by: Hari Kanigeri <h-kanigeri2@xxxxxx>> ---> + if (pfn_valid(__phys_to_pfn(patemp))) {> + pg = phys_to_page(patemp);> + get_page(pg); get_page() makes sure that page->count is not zero and atomically increments it.That means after execution of get_page(); page->count will be always 1or greaterthan 1. 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. > + if (page_count(pg) < 1) {> + printk(KERN_EMERG "DSPBRIDGE:MAP "> + "function: COUNT 0 FOR PA "> + "0x%x\n", patemp);> + printk(KERN_EMERG "Bad page state"> + "in process '%s'\n"> + "page:%p flags:0x%0*lx "> + "mapping:%p mapcount:%d "> + "count:%d\n"> + "Trying to fix it up, but "> + "a reboot is needed\n"> + "Backtrace:\n",> + current->comm, pg,> + (int)(2*sizeof(unsigned long)),> + (unsigned long)pg->flags,> + pg->mapping, page_mapcount(pg),> + page_count(pg));> + dump_stack();> + BUG_ON(1);> + } Cheers,Ameya.��.n��������+%������w��{.n�����{�������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f