traversing mmlist

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

 



 hi,

   I am having some problems with traversing the mmlist... i am not
catching all the mm_structs in the list... the loop i have used is

  struct mm_struct *mm;
  struct list_head *p = &init_mm.mmlist;
  spin_lock(&mmlist_lock);
  p = p->next;
  mm = list_entry(p, struct mm_struct, mmlist);

  while(mm != &init_mm) {
	/* do what i need to do on the mm_struct */
        p = p->next;
	mm = list_entry(p, struct mm_struct, mmlist);
  }
  spin_unlock(&mmlist_lock);


  is there a problem in the way I am traversing the list. OR is there a
better way to do the same.

 Thanks a lot,
Raghu
--
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