Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1691832 > unrolled thread
| Started by | Petr Mladek <pmladek@suse.com> |
|---|---|
| First post | 2017-07-19 17:10 +0200 |
| Last post | 2017-07-19 17:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 2/2] livepatch: add shadow variable sample programs Petr Mladek <pmladek@suse.com> - 2017-07-19 17:10 +0200
| From | Petr Mladek <pmladek@suse.com> |
|---|---|
| Date | 2017-07-19 17:10 +0200 |
| Subject | Re: [PATCH v2 2/2] livepatch: add shadow variable sample programs |
| Message-ID | <u4YLW-1Q5-49@gated-at.bofh.it> |
On Wed 2017-06-28 11:37:27, Joe Lawrence wrote: > Add sample livepatch modules to demonstrate the shadow variable API. > > Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com> > --- > diff --git a/samples/livepatch/livepatch-shadow-mod.c b/samples/livepatch/livepatch-shadow-mod.c > new file mode 100644 > index 000000000000..423f4b7b0adb > --- /dev/null > +++ b/samples/livepatch/livepatch-shadow-mod.c > + > +#define T1_PERIOD 1 /* allocator thread */ > +#define T2_PERIOD (3 * T1_PERIOD) /* cleanup thread */ > + > + > + /* Dummies live long enough to see a few t2 instances */ > + d->jiffies_expire = jiffies + 1000 * 4 * T2_PERIOD; One more thing that I realized later. This will depend on HZ. Also above defined periods are later multiplied by 4 or 2 so that it is not easy to understand and tune. I would suggest to define the exact periods in ms on one location: #define ALLOC_PERIOD_MSEC 10 #define FREE_PERIOD_MSEC (6 * ALLOC_PERIOD_MSEC) #define EXPIRE_PERIOD_MSEC (24 * ALLOC_PERION_MSEC) and then use msec_to_jiffies(XXX_PERIOD_MSEC) on the respective locations. Huh, I should reduce my alarm level. This is just an example code after all. Best Regards, Petr
Back to top | Article view | linux.kernel
csiph-web