Thread (140 messages) 140 messages, 21 authors, 2018-12-04

Re: [PATCH 10/17] prmem: documentation

From: Andy Lutomirski <luto@amacapital.net>
Date: 2018-10-31 23:20:14
Also in: linux-doc, linux-integrity, lkml

On Wed, Oct 31, 2018 at 4:10 PM Igor Stoppa [off-list ref] wrote:


On 01/11/2018 00:57, Andy Lutomirski wrote:
quoted
quoted
On Oct 31, 2018, at 2:00 PM, Peter Zijlstra [off-list ref] wrote:

quoted
quoted
I _think_ the use-case for atomics is updating the reference counts of
objects that are in this write-rare domain. But I'm not entirely clear
on that myself either. I just really want to avoid duplicating that
stuff.
Sounds nuts. Doing a rare-write is many hundreds of cycles at best. Using that for a reference count sounds wacky.

Can we see a *real* use case before we over complicate the API?

Does patch #14 of this set not qualify? ima_htable.len ?

https://www.openwall.com/lists/kernel-hardening/2018/10/23/20
Do you mean this (sorry for whitespace damage):

+ pratomic_long_inc(&ima_htable.len);

- atomic_long_inc(&ima_htable.len);
  if (update_htable) {
    key = ima_hash_key(entry->digest);
-   hlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]);
+   prhlist_add_head_rcu(&qe->hnext, &ima_htable.queue[key]);
  }

ISTM you don't need that atomic operation -- you could take a spinlock
and then just add one directly to the variable.

--Andy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help