All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: Christian Thaeter <ct@pipapo.org>
Cc: linux-kernel@vger.kernel.org, Pavel Machek <pavel@ucw.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] hpfall.c improvements, thoughts
Date: Wed, 20 May 2009 23:04:56 +0200	[thread overview]
Message-ID: <4A147078.6020208@tremplin-utc.net> (raw)
In-Reply-To: <49CAA1DF.8060109@pipapo.org>

Op 25-03-09 22:27, Christian Thaeter schreef:
> Some conversation I had with Pavel,
> 
> imo the example code should be at least barely useable as in not causing
> harm like I sketched in (1.). Maybe someone else picks that up and
> improves it later on. Patch at the end, quite sketchy and imature as it
> doesn't check for errors, but certainly better than before.
> 
Hello Christian,
Would you mind resending the patch with a changelog, so that Andrew can
merge it?

Thanks,
Eric

> 
> Signed-off-by: Christian Thaeter <ct@pipapo.org>
Acked-by: Éric Piel <eric.piel@tremplin-utc.net>

> ---
> 
> diff --git a/Documentation/hwmon/hpfall.c b/Documentation/hwmon/hpfall.c
> index bbea1cc..f3cde67 100644
> --- a/Documentation/hwmon/hpfall.c
> +++ b/Documentation/hwmon/hpfall.c
> @@ -16,6 +16,8 @@
>  #include <stdint.h>
>  #include <errno.h>
>  #include <signal.h>
> +#include <sys/mman.h>
> +#include <sched.h>
> 
>  void write_int(char *path, int i)
>  {
> @@ -63,6 +65,7 @@ void ignore_me(void)
>  int main(int argc, char* argv[])
>  {
>         int fd, ret;
> +       struct sched_param param;
> 
>         fd = open("/dev/freefall", O_RDONLY);
>         if (fd < 0) {
> @@ -70,7 +73,12 @@ int main(int argc, char* argv[])
>                 return EXIT_FAILURE;
>         }
> 
> -	signal(SIGALRM, ignore_me);
> +       daemon(0,0);
> +       param.sched_priority = sched_get_priority_max(SCHED_FIFO);
> +       sched_setscheduler(0, SCHED_FIFO, &param);
> +       mlockall(MCL_CURRENT|MCL_FUTURE);
> +
> +       signal(SIGALRM, ignore_me);
> 
>         for (;;) {
>  	       unsigned char count;


      parent reply	other threads:[~2009-05-20 21:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <49C8F338.7030901@pipapo.org>
     [not found] ` <20090324211555.GA24172@elf.ucw.cz>
2009-03-25 21:27   ` [PATCH] hpfall.c improvements, thoughts Christian Thaeter
2009-03-25 21:33     ` Pavel Machek
2009-05-20 21:04     ` Éric Piel [this message]

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=4A147078.6020208@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=akpm@linux-foundation.org \
    --cc=ct@pipapo.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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.