Re: Interrupt and spin_lock

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

 



On 8/24/05, Vincenzo Mallozzi <vinjunior@xxxxxxxx> wrote:
> As you've suggested, I've changed my programs this way:
> 
>     for(vm = mm->mmap; vm != NULL; vm = vm->vm_next)
>             vma = mtpmc_mk_vm_wrprotected(vm);
>             for (addr = vm->vm_start; addr<vm->vm_end; addr+=PAGE_SIZE){
>                 pte = mtpmc_get_pte_from_address(mm, addr);
>                 if (pte != NULL)
>                     if (pte_write(*pte)){
>                         set_pte(pte, pte_wrprotect(*pte));
>                         page = mtpmc_mk_page_wrprotected(addr);
>                         list_add_tail(&page->list, &vma->pages_list);
>                     }
>             }
>             list_add_tail(&vma->list, &vm_write_protected);
>             vma->vm_start = vm->vm_start;
>             vma->vm_end = vma->vm_end;
> 
> And all works well. But I've once again the problem of "Unable to hanlde
> NULL..." when I try, after the operations above, to delete/add an element in
> the page list associated with a vma.
> When I want to di it, I execute:
> 
>   vma = list_entry(vma_list, struct mtpmc_vm_wrprotected, list);
>   list_for_each_safe(page_list, temp_page_list, &wr_vma->pages_list){
>        page = mtpmc_mk_page_wrprotected(addr);

I think you are not initializing the list element of page structure in
above function, you need to do that before adding it to page list. If
you are not doing it, just tey this, hope it will resolve your
problem.

Its the basic rule, do initialize all the elements of a structure
before adding that to any global list.

>        list_add_tail(&page->list,&wr_vma->pages_list);
>         /* or  list_del_init(page_list); */
>   }
> 

you need to do this all under the control of spinlocks, I hope you are
doing that ......

-Gaurav

> It seems to be the same error that I've exposed in my previous email.
> When I'm wrong?
> Thanks.
> Vincenzo Mallozzi.
> 
> 
> 
> 
> 
> ___________________________________
> Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
> http://mail.yahoo.it
> 
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
>

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