* [PATCH, RFC] kill odd mm context pinning hack in frv
@ 2005-08-11 17:23 Christoph Hellwig
2005-08-11 17:57 ` David Howells
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2005-08-11 17:23 UTC (permalink / raw)
To: dhowells; +Cc: linux-kernel
David, is that more than a debugging aid? I'm trying to get rid of
tasklist_lock users and this one looks really suspicios..
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/arch/frv/kernel/sysctl.c
===================================================================
--- linux-2.6.orig/arch/frv/kernel/sysctl.c 2005-08-11 16:45:53.000000000 +0200
+++ linux-2.6/arch/frv/kernel/sysctl.c 2005-08-11 19:17:24.000000000 +0200
@@ -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 }
};
Index: linux-2.6/include/asm-frv/mmu.h
===================================================================
--- linux-2.6.orig/include/asm-frv/mmu.h 2005-08-11 16:46:04.000000000 +0200
+++ linux-2.6/include/asm-frv/mmu.h 2005-08-11 19:18:10.000000000 +0200
@@ -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 */
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH, RFC] kill odd mm context pinning hack in frv
2005-08-11 17:23 [PATCH, RFC] kill odd mm context pinning hack in frv Christoph Hellwig
@ 2005-08-11 17:57 ` David Howells
0 siblings, 0 replies; 2+ messages in thread
From: David Howells @ 2005-08-11 17:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: dhowells, linux-kernel
Christoph Hellwig <hch@lst.de> wrote:
> David, is that more than a debugging aid? I'm trying to get rid of
> tasklist_lock users 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-11 17:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11 17:23 [PATCH, RFC] kill odd mm context pinning hack in frv Christoph Hellwig
2005-08-11 17:57 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox