kill odd mm context pinning hack in frv
RFC PATCH 1/1 kill odd mm context pinning hack in frv
David, is that more than a debugging aid? I'm trying to get rid oftasklist_lock users and this one looks really suspicios..
Signed-off-by Christoph Hellwig <[email protected]>
arch/frv/kernel/sysctl.c +0 -57
@@ -117,69 +117,12 @@ }/* end procctl_frv_cachemode() */ -/*****************************************************************************/ -/* -* permit the mm_struct the nominated process is using have its MMU context ID pinned -*/ -#ifdef CONFIG_MMU -static int procctl_frv_pin_cxnr (ctl_table *table,int write,struct file *filp, -void *buffer,size_t *lenp,loff_t *ppos) -{ -pid_t pid; -char buff[16 ], *p; -int len; - - len = *lenp; - -if (write) { -/* potential state change */ -if (len <=1 || len >sizeof (buff) -1 ) -return -EINVAL ; - -if (copy_from_user (buff, buffer, len) !=0 ) -return -EFAULT ; - -if (buff[len -1 ] =='\n' ) - buff[len -1 ] ='\0' ; -else - buff[len] ='\0' ; - - pid =simple_strtoul (buff, &p,10 ); -if (*p) -return -EINVAL ; - -return cxn_pin_by_pid (pid); - } - -/* read the currently pinned CXN */ -if (filp->f_pos >0 ) { - *lenp =0 ; -return 0 ; - } - - len =snprintf (buff,sizeof (buff),"%d\n" , cxn_pinned); -if (len > *lenp) - len = *lenp; - -if (copy_to_user (buffer, buff, len) !=0 ) -return -EFAULT ; - - *lenp = len; - filp->f_pos = len; -return 0 ; - -}/* end procctl_frv_pin_cxnr() */ -#endif -/* * FR-V specific sysctls */ static struct ctl_table frv_table[] = { {1 ,"cache-mode" ,NULL ,0 ,0644 ,NULL , &procctl_frv_cachemode }, -#ifdef CONFIG_MMU - {2 ,"pin-cxnr" ,NULL ,0 ,0644 ,NULL , &procctl_frv_pin_cxnr }, -#endif {0 } };
include/asm-frv/mmu.h +0 -5
@@ -34,9 +34,4 @@ } mm_context_t; -#ifdef CONFIG_MMU -extern int __nongpreldata cxn_pinned; -extern int cxn_pin_by_pid (pid_t pid); -#endif -#endif /* _ASM_MMU_H */
Quoted 2 lines · Christoph Hellwig
David, is that more than a debugging aid? I'm trying to get rid of
tasklist_lockusers and this one looks really suspicios..
Yes. The FR451 CPU (the only one with an MMU at the moment) has accounting and profiling aids that are enabled by the context number set in the CXNR register. This context number also selectively enables TLB entries on a per-mm context basis.
So to profile a process you pin a context number to that process, and then the profiling h/w is only active for that process.
David