[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <838805e5-c2a6-e3f3-d2e7-d435f07b9bda@ryhl.io>
Date: Fri, 16 Jun 2023 15:24:43 +0200
From: Alice Ryhl <alice@...l.io>
To: Andrew Lunn <andrew@...n.ch>
Cc: Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
rust-for-linux@...r.kernel.org, aliceryhl@...gle.com,
miguel.ojeda.sandonis@...il.com, FUJITA Tomonori <fujita.tomonori@...il.com>
Subject: Re: [PATCH 0/5] Rust abstractions for network device drivers
On 6/16/23 15:20, Andrew Lunn wrote:
>> As for this being a single function rather than four functions, that's
>> definitely a debatable decision. You would only do that if it makes sense to
>> merge them together and if you would always assign all of them together. I
>> don't know enough about these fields to say whether it makes sense here.
>
> It can actually make sense to do them all together, because the source
> of these is likely to be a per CPU data structure protected by a per
> CPU sequence lock. You iterate over all CPUs, doing a transaction,
> taking the sequence lock, copy the values, and then releasing the
> lock. Taking and releases the lock per value is unnecessary expense.
It can probably be split into several methods without introducing a lock
call for each one, if the API is designed right.
Alice
Powered by blists - more mailing lists