Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485509

Re: [REGRESSION] RLIMIT_DATA crashes named

From Cyrill Gorcunov <gorcunov@gmail.com>
Newsgroups linux.kernel
Subject Re: [REGRESSION] RLIMIT_DATA crashes named
Date 2016-09-17 11:20 +0200
Message-ID <sijWW-GT-11@gated-at.bofh.it> (permalink)
References (4 earlier) <si9Xz-2wp-1@gated-at.bofh.it> <sibcZ-3e3-1@gated-at.bofh.it> <sibmF-3x5-1@gated-at.bofh.it> <sif6W-61z-9@gated-at.bofh.it> <sijkd-ei-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Sep 17, 2016 at 11:33:56AM +0300, Konstantin Khlebnikov wrote:
> >
> > do_just_once just isn't a good name for a global
> > rate limited mechanism that does something very
> > different than the name.
> >
> > Maybe allow_once_per_ratelimit or the like
> >
> > There could be an equivalent do_once
> >
> > https://lkml.org/lkml/2009/5/22/3
> >
> 
> What about this printk_reriodic() and pr_warn_once_per_minute()?
> 
> It simply remembers next jiffies to print rather than using that
> complicated ratelimiting engine.

+#define printk_periodic(period, fmt, ...)                      \
+({                                                             \
+	static unsigned long __print_next __read_mostly = INITIAL_JIFFIES; \
+	bool __do_print = time_after_eq(jiffies, __print_next); \
+                                                               \
+	if (__do_print) {                                       \
+               __print_next = jiffies + (period);              \
+               printk(fmt, ##__VA_ARGS__);                     \
+	}                                                       \
+	unlikely(__do_print);                                   \
+})

Seems I don't understand the bottom unlikely...

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[REGRESSION] RLIMIT_DATA crashes named Laura Abbott <labbott@redhat.com> - 2016-09-16 17:20 +0200
  Re: [REGRESSION] RLIMIT_DATA crashes named Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-16 19:50 +0200
    Re: [REGRESSION] RLIMIT_DATA crashes named Laura Abbott <labbott@redhat.com> - 2016-09-16 22:20 +0200
      Re: [REGRESSION] RLIMIT_DATA crashes named Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-16 22:40 +0200
        Re: [REGRESSION] RLIMIT_DATA crashes named Sam Varshavchik <mrsam@courier-mta.com> - 2016-09-17 00:40 +0200
          Re: [REGRESSION] RLIMIT_DATA crashes named Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-17 02:00 +0200
            Re: [REGRESSION] RLIMIT_DATA crashes named Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-17 02:10 +0200
              Re: [REGRESSION] RLIMIT_DATA crashes named Joe Perches <joe@perches.com> - 2016-09-17 06:10 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Konstantin Khlebnikov <koct9i@gmail.com> - 2016-09-17 10:40 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-17 11:20 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Konstantin Khlebnikov <koct9i@gmail.com> - 2016-09-17 14:10 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Cyrill Gorcunov <gorcunov@gmail.com> - 2016-09-17 14:30 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Konstantin Khlebnikov <koct9i@gmail.com> - 2016-09-17 23:50 +0200
                Re: [REGRESSION] RLIMIT_DATA crashes named Joe Perches <joe@perches.com> - 2016-09-18 00:00 +0200

csiph-web