public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* bizarre 2.6.8.1 /sys permissions
@ 2004-08-25 20:25 Dan Hollis
  2004-08-25 22:18 ` Dave Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Hollis @ 2004-08-25 20:25 UTC (permalink / raw)
  To: linux-kernel

replies cc: in email, i'm not subscribed to the list.

Do these file permissions make sense to anyone?

$ uname -r
2.6.8.1
$ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied
$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Celeron(R) CPU 2.60GHz
stepping        : 9
cpu MHz         : 324.528
[...]

$ ls -al /proc/cpuinfo 
-r--r--r--  1 root root 0 Aug 25 13:18 /proc/cpuinfo
$ ls -la /sys/devices/system/cpu/cpu0/cpufreq/
total 0
drwxr-xr-x  2 root root    0 Aug 23 13:06 .
drwxr-xr-x  3 root root    0 Aug 23 13:06 ..
-r--------  1 root root 4096 Aug 23 13:06 cpuinfo_cur_freq
-r--r--r--  1 root root 4096 Aug 23 13:06 cpuinfo_max_freq
-r--r--r--  1 root root 4096 Aug 23 13:06 cpuinfo_min_freq
-r--r--r--  1 root root 4096 Aug 23 13:06 scaling_available_frequencies
-r--r--r--  1 root root 4096 Aug 23 13:06 scaling_available_governors
-r--r--r--  1 root root 4096 Aug 23 13:06 scaling_cur_freq
-r--r--r--  1 root root 4096 Aug 23 13:06 scaling_driver
-rw-r--r--  1 root root    0 Aug 25 13:19 scaling_governor
-rw-r--r--  1 root root 4096 Aug 23 13:06 scaling_max_freq
-rw-r--r--  1 root root 4096 Aug 23 13:06 scaling_min_freq
-rw-r--r--  1 root root    0 Aug 25 13:19 scaling_setspeed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bizarre 2.6.8.1 /sys permissions
  2004-08-25 20:25 bizarre 2.6.8.1 /sys permissions Dan Hollis
@ 2004-08-25 22:18 ` Dave Jones
  2004-08-25 23:31   ` Dan Hollis
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Jones @ 2004-08-25 22:18 UTC (permalink / raw)
  To: Dan Hollis; +Cc: linux-kernel

On Wed, Aug 25, 2004 at 01:25:12PM -0700, Dan Hollis wrote:


 > Do these file permissions make sense to anyone?

Yes.

 > $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
 > cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied

Reading this file causes reads from hardware on some cpufreq drivers.
This can be a slow operation, so a user could degrade system performance
for everyone else by repeatedly cat'ing it.

 > $ cat /proc/cpuinfo
 > processor       : 0
 > vendor_id       : GenuineIntel
 > cpu family      : 15
 > model           : 2
 > model name      : Intel(R) Celeron(R) CPU 2.60GHz
 > stepping        : 9
 > cpu MHz         : 324.528

This is read from the cpu_khz variable, so isn't affected by
this problem.

 > $ ls -la /sys/devices/system/cpu/cpu0/cpufreq/
 > total 0
 > drwxr-xr-x  2 root root    0 Aug 23 13:06 .
 > drwxr-xr-x  3 root root    0 Aug 23 13:06 ..
 > -r--------  1 root root 4096 Aug 23 13:06 cpuinfo_cur_freq
 > -r--r--r--  1 root root 4096 Aug 23 13:06 cpuinfo_max_freq
 > -r--r--r--  1 root root 4096 Aug 23 13:06 cpuinfo_min_freq
 > -r--r--r--  1 root root 4096 Aug 23 13:06 scaling_available_frequencies
 > -r--r--r--  1 root root 4096 Aug 23 13:06 scaling_available_governors
 > -r--r--r--  1 root root 4096 Aug 23 13:06 scaling_cur_freq
 > -r--r--r--  1 root root 4096 Aug 23 13:06 scaling_driver
 > -rw-r--r--  1 root root    0 Aug 25 13:19 scaling_governor
 > -rw-r--r--  1 root root 4096 Aug 23 13:06 scaling_max_freq
 > -rw-r--r--  1 root root 4096 Aug 23 13:06 scaling_min_freq
 > -rw-r--r--  1 root root    0 Aug 25 13:19 scaling_setspeed

Looks fine to me.

		Dave


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bizarre 2.6.8.1 /sys permissions
  2004-08-25 22:18 ` Dave Jones
@ 2004-08-25 23:31   ` Dan Hollis
  2004-08-26  0:48     ` Dave Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Hollis @ 2004-08-25 23:31 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel

>  > $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
>  > cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied
> Reading this file causes reads from hardware on some cpufreq drivers.
> This can be a slow operation, so a user could degrade system performance
> for everyone else by repeatedly cat'ing it.

any reason why cpuinfo_cur_freq cant read cpu_khz ?

or rather, is there any reason why cpuinfo_cur_freq and /proc/cpuinfo 
should legitimately differ?

-Dan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bizarre 2.6.8.1 /sys permissions
  2004-08-25 23:31   ` Dan Hollis
@ 2004-08-26  0:48     ` Dave Jones
  2004-08-26 19:00       ` Bill Davidsen
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Jones @ 2004-08-26  0:48 UTC (permalink / raw)
  To: Dan Hollis; +Cc: linux-kernel

On Wed, Aug 25, 2004 at 04:31:50PM -0700, Dan Hollis wrote:
 > >  > $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
 > >  > cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied
 > > Reading this file causes reads from hardware on some cpufreq drivers.
 > > This can be a slow operation, so a user could degrade system performance
 > > for everyone else by repeatedly cat'ing it.
 > 
 > any reason why cpuinfo_cur_freq cant read cpu_khz ?

cpufreq_cur_freq will be one of scaling_available_frequencies.
These are usually a value such as 1300MHz, where cpu_mhz is a
'measured' value and will look something like 1303.852

the values cpufreq uses are the values either returned by the
hardware as its settable states, or from BIOS tables defining
those states.

 > or rather, is there any reason why cpuinfo_cur_freq and /proc/cpuinfo 
 > should legitimately differ?

They aren't identical, and serve different purposes.

		Dave


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: bizarre 2.6.8.1 /sys permissions
  2004-08-26  0:48     ` Dave Jones
@ 2004-08-26 19:00       ` Bill Davidsen
  0 siblings, 0 replies; 5+ messages in thread
From: Bill Davidsen @ 2004-08-26 19:00 UTC (permalink / raw)
  To: linux-kernel

Dave Jones wrote:
> On Wed, Aug 25, 2004 at 04:31:50PM -0700, Dan Hollis wrote:
>  > >  > $ cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
>  > >  > cat: /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq: Permission denied
>  > > Reading this file causes reads from hardware on some cpufreq drivers.
>  > > This can be a slow operation, so a user could degrade system performance
>  > > for everyone else by repeatedly cat'ing it.
>  > 
>  > any reason why cpuinfo_cur_freq cant read cpu_khz ?
> 
> cpufreq_cur_freq will be one of scaling_available_frequencies.
> These are usually a value such as 1300MHz, where cpu_mhz is a
> 'measured' value and will look something like 1303.852
> 
> the values cpufreq uses are the values either returned by the
> hardware as its settable states, or from BIOS tables defining
> those states.
> 
>  > or rather, is there any reason why cpuinfo_cur_freq and /proc/cpuinfo 
>  > should legitimately differ?
> 
> They aren't identical, and serve different purposes.

Okay, so cpufreq just gives informational values in a table while 
/proc/cpuinfo actually reflects the speed of the CPU. Right? That's 
good, I thought there was an problem if they were different.

-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-08-26 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-25 20:25 bizarre 2.6.8.1 /sys permissions Dan Hollis
2004-08-25 22:18 ` Dave Jones
2004-08-25 23:31   ` Dan Hollis
2004-08-26  0:48     ` Dave Jones
2004-08-26 19:00       ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox