Skip to contentSkip to conversation

sysctl vs /proc/sys

DISCUSSION YOSHIFUJI Hideaki / 吉藤英明 5 participants 9 messages Dec 12, 2003 – Dec 13, 2003

lore
Share & tools
lore
#0 lore raw

Hello.

sysctl(2) seems to be deprecated, but
IMHO, /proc/sys cannot be the alternative because it cannot return "previous" value atomicly.

I would say it is okay to leave sysctl(2) because the interface is very common.
Or, I'd rather propose introducing sysctlbyname(2).

.. or do I miss something?

--yoshfuji

#2 lore raw

In article <[email protected]> (at Fri, 12 Dec 2003 08:20:41 -0500 (EST)), James Morris <[email protected]> says:

Quoted 6 lines · On Fri, 12 Dec 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:
Quoted 2 lines

Or, I'd rather propose introducing sysctlbyname(2).

See the thread at
http://marc.theaimsgroup.com/?l=linux-kernel&m=105788786819578&w=2

Thanks, James. I think I missed the thread.

Well, some applications which can run on *BSD* and Linux uses sysctl. Because using procfs changes the semantics, I'd love to have sysctlbyname().

Can we get the exact previous value from /proc/sys atomicly? If so, I'm ok not to have sysctlbyname(2)
because we can have sysctlbyname(3).

If no, please let's have sysctlbyname(2); there ARE something we cannot do only without sysctl variants.

Note: sysctlbyname(3) and sysctlnametomib(3) is in FreeBSD.

--yoshfuji

#3 lore raw
Quoted 1 line · On Fri, 12 Dec 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:

Can we get the exact previous value from /proc/sys atomicly?

I'm not sure what you mean by this.

- James

Signature · 2 lines
James Morris
<[email protected]>
#4 lore raw
Quoted 5 lines · James Morris
Quoted 1 line · On Fri, 12 Dec 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote:

Can we get the exact previous value from /proc/sys atomicly?

I'm not sure what you mean by this.

Read value and modify in one op?

#5 lore raw

In article <[email protected]> (at Fri, 12 Dec 2003 10:15:17 -0800), Mike Fedyk <[email protected]> says:

Quoted 8 lines · James Morris
Quoted 5 lines · On Fri, 12 Dec 2003, YOSHIFUJI Hideaki / [iso-2022-jp] 吉藤英明 wrote:
Quoted 2 lines

Can we get the exact previous value from /proc/sys atomicly?

I'm not sure what you mean by this.

Read value and modify in one op?

Yes, I meant to read old value and to set new one in one system call. The sysctl system-call does lock_kernel, so sysctl(2) sytem-call are serialized.

How about procfs? Are there locks between multiple read-and-write? Since It seems user-space cannot (or even should not) let kernel hold lock(s) during read-and-write operation, procfs cannot be the alternative.

Do I mis-understand something?

--yoshfuji

#6 lore raw
Followup to:  <[email protected]>
By author:    YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= <[email protected]>
In newsgroup: linux.dev.kernel
Quoted 5 lines

Yes, I meant to read old value and to set new one in one system call. The sysctl system-call does lock_kernel, so sysctl(2) sytem-call are serialized.

Dumb question... what do you need this for? sysctl is mostly used to initialization-time stuff... In most cases you can use flock(), probably, although that is advisory and not compulsory.

-hpa

Signature · 4 lines
<[email protected]> at work, <[email protected]> in private!
If you send me mail in HTML format I will assume it's spam.
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
#7 lore raw

Linux Kernel 2.6.0-test11 VFS problem

Hi, I am trying to get kernel 2.6.0-test11 on my
laptop. this is really stupid, I got all the "latest" utilities etc... etc... etc...

But when I boot i get this error

###################################
VFS Cannot open root device "hda5"
Please append a correct "root=" boot option Kernel Panic: VFS: Unable to mount root filesystem on hda5
###################################

here is my grub.conf file

*******************************
title 2.6-test-11

        root (hd0,1)
        kernel /vmlinuz-2.6-test-11 ro root=305

********************************

What am I doing wrong today ??

I know this is something really simple somwhere, but I am giving this up and hitting up and hitting a Pilsner Urquell.....

--
Recruiter: "How do you write a perl script?"
Canidate : "You type it."
-Actual phone interview, Circa Nov 2003

#8 lore raw

Re: Linux Kernel 2.6.0-test11 VFS problem

Quoted 5 lines · Ananda Bhattacharya

###################################
VFS Cannot open root device "hda5"
Please append a correct "root=" boot option Kernel Panic: VFS: Unable to mount root filesystem on hda5
###################################

What filesystem is on hda5? and did you specify it as /dev/hda5? and did you compile that filesystem into your kernel (ie, not as a module)?