All of lore.kernel.org
 help / color / mirror / Atom feed
From: Micha Feigin <michf@post.tau.ac.il>
To: lkml <linux-kernel@vger.kernel.org>
Subject: Re: finding out the value of HZ from userspace
Date: Sun, 14 Mar 2004 03:05:09 +0200	[thread overview]
Message-ID: <20040314010508.GL5960@luna.mooo.com> (raw)
In-Reply-To: <1079217159.4915.0.camel@laptop.fenrus.com>

On Sat, Mar 13, 2004 at 11:32:39PM +0100, Arjan van de Ven wrote:
> On Sat, 2004-03-13 at 23:14, Micha Feigin wrote:
> > On Sat, Mar 13, 2004 at 08:38:52PM +0100, Arjan van de Ven wrote:
> > > On Sat, Mar 13, 2004 at 11:34:37AM -0800, John Reiser wrote:
> > > > Arjan van de Ven wrote:
> > > > >On Thu, 2004-03-11 at 15:17, Micha Feigin wrote:
> > > > >
> > > > >>Is it possible to find out what the kernel's notion of HZ is from user
> > > > >>space?
> > > > >>It seem to change from system to system and between 2.4 (100 on i386)
> > > > >>to 2.6 (1000 on i386).
> > > > >
> > > > >
> > > > >if you can see 1000 from userspace that is a bad kernel bug; can you say
> > > > >where you find something in units of 1000 ?
> > > > 
> > > > create_elf_tables() in fs/binfmt_elf.c tells every ELF execve():
> > > >         NEW_AUX_ENT(AT_CLKTCK, CLOCKS_PER_SEC);
> > > > which can be found by crawling through the stack above the pointer
> > > > to the last environment variable.
> > > 
> > > Ugh that should say 100 on x86....
> > > but..
> > > param.h:# define USER_HZ        100             /* .. some user interfaces are in "ticks" */
> > > param.h:# define CLOCKS_PER_SEC (USER_HZ)       /* like times() */
> > > .....
> > > that looks like 100 to me.
> > > 
> > 
> > When dealing with bdflush and a few other interfaces the values need to
> > be in jiffies which requires knowledge of the kernels notion of HZ not
> > userspace.
> 
> Wrong. Any such interface is supposed to convert automatically. Any
> interface you can find that doesn't should be reported as a serious bug!
> 

Like I said, look at bdflush in 2.4 (this was fixed with the changed 2.6
interface) and xfs proc interface in both 2.4 and 2.6.
In light of your post then there is a serious bug.

For example for bdflush age_buffer field (true for the other used fields
also), no conversion:
	bh->b_flushtime = jiffies + bdf_prm.b_un.age_buffer;

For xfs flush interval:
if (pbd_active == 1) {
			mod_timer(&pb_daemon_timer,
				  jiffies + pb_params.flush_interval.val);
			interruptible_sleep_on(&pbd_waitq);
		}

xfs should be converted to centisecs, bdflush should also be converted
to centisecs, or the interface from 2.6 should somehow be ported to
exist in parallel to the 2.4 one.

I don't mind making a patch, which approach should be used?

  reply	other threads:[~2004-03-14  1:06 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <michf@post.tau.ac.il>
2004-03-11 14:17 ` finding out the value of HZ from userspace Micha Feigin
2004-03-13 17:24   ` Arjan van de Ven
2004-03-13 19:34     ` John Reiser
2004-03-13 19:38       ` Arjan van de Ven
2004-03-13 22:14         ` Micha Feigin
2004-03-13 22:32           ` Arjan van de Ven
2004-03-14  1:05             ` Micha Feigin [this message]
2004-03-14  1:49               ` Andrew Morton
2004-03-14 14:37                 ` Micha Feigin
2004-03-16  0:28         ` Peter Williams
2004-03-16  6:33           ` Arjan van de Ven
2004-03-16 23:38             ` Peter Williams
2004-03-20 10:22               ` Arjan van de Ven
2004-03-20 11:28                 ` Stefan Smietanowski
2004-03-20 11:41                   ` Arjan van de Ven
2004-03-20 23:58                     ` Peter Williams
2004-03-21  1:09                       ` Tim Schmielau
2004-03-21  1:30                         ` Peter Williams
2004-03-21  8:00                   ` Kai Henningsen
2004-03-21 10:32                     ` Stefan Smietanowski
2004-03-22 22:34                   ` Micha Feigin
2004-03-22 23:04                     ` Peter Williams
2004-03-25 17:40                       ` Jamie Lokier
2004-03-25 23:22                         ` Peter Williams
2004-03-27 13:31                           ` Jamie Lokier
2004-03-27 23:52                             ` Peter Williams
2004-03-28 12:16                               ` Jamie Lokier
2004-03-27 21:11                       ` Micha Feigin
2004-03-20 23:26                 ` Peter Williams
2004-03-13 21:19     ` tabris
2004-03-13 22:10     ` Micha Feigin
2004-03-13 22:41       ` Arjan van de Ven
2004-03-14  1:07         ` Micha Feigin
2004-03-14 18:26         ` John Reiser
2004-03-14  2:45   ` Horst von Brand
2004-03-14 14:39     ` Micha Feigin
2004-03-15  8:17     ` Jamie Lokier
2004-03-16 18:16       ` Mark Gross
2004-03-15 10:13     ` Richard Curnow
     [not found]   ` <200403161757.48786.mgross@linux.intel.com>
     [not found]     ` <20040317023059.GD19564@mail.shareable.org>
2004-03-17 16:48       ` Call for HRT in 2.6 kernel was " Mark Gross
2004-03-17 20:07         ` Jamie Lokier
2004-03-17 21:25           ` Mark Gross
2004-03-18  1:19           ` Karim Yaghmour
2004-03-18 11:56             ` Jamie Lokier
2004-03-18 15:23               ` Karim Yaghmour
2004-03-21  1:55                 ` Erik Andersen
2004-03-23 22:35                   ` Karim Yaghmour
     [not found] <1zkOe-Uc-17@gated-at.bofh.it>
     [not found] ` <1zl7M-1eJ-43@gated-at.bofh.it>
     [not found]   ` <1zn9p-3mW-5@gated-at.bofh.it>
     [not found]     ` <1znj5-3wM-15@gated-at.bofh.it>
     [not found]       ` <1AaWr-655-7@gated-at.bofh.it>
2004-03-16  2:27         ` Andi Kleen
2004-03-16  5:53           ` Peter Williams
2004-03-16  6:16             ` Andi Kleen
2004-03-16 23:15               ` Peter Williams
2004-03-16 23:56                 ` Andi Kleen
2004-03-17  0:15                   ` Peter Williams
2004-03-16  9:16             ` Bernd Petrovitsch
2004-03-16 23:45               ` Peter Williams
2004-03-16 16:14 Albert Cahalan
2004-03-16 17:22 ` Richard Curnow
2004-03-20  9:56 ` Arjan van de Ven
2004-03-20 14:54   ` Albert Cahalan
2004-03-20 23:58     ` Peter Williams
2004-03-31 21:40       ` Randy.Dunlap
2004-03-31 23:46         ` Albert Cahalan
2004-04-01 15:54           ` Jamie Lokier
2004-04-01 16:01             ` Arjan van de Ven
2004-04-01 16:30               ` Jamie Lokier
2004-04-01 16:50                 ` Richard B. Johnson
2004-04-01 17:01                   ` Jamie Lokier
2004-04-01 21:27                   ` Michael Buesch
2004-04-02  0:16                   ` Peter Williams
2004-04-02  0:07                 ` Peter Williams
2004-04-02  0:39                   ` Jamie Lokier
2004-04-02  1:44                     ` Peter Williams
2004-04-02 18:28                       ` Tim Bird
2004-04-02 22:05                         ` Peter Williams
2004-04-01 16:12             ` Albert Cahalan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040314010508.GL5960@luna.mooo.com \
    --to=michf@post.tau.ac.il \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.