|
From: | Xiao Guangrong |
Subject: | Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue |
Date: | Mon, 26 Nov 2018 16:06:37 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 11/24/18 8:12 AM, Emilio G. Cota wrote:
On Thu, Nov 22, 2018 at 15:20:25 +0800, address@hidden wrote:+ /* + * the bit in these two bitmaps indicates the index of the ï¼ requestsThis @ is not ASCII, is it?
Good eyes. :) Will fix it.
+ * respectively. If it's the same, the corresponding request is free + * and owned by the user, i.e, where the user fills a request. Otherwise, + * it is valid and owned by the thread, i.e, where the thread fetches + * the request and write the result. + */ + + /* after the user fills the request, the bit is flipped. */ + uint64_t request_fill_bitmap QEMU_ALIGNED(SMP_CACHE_BYTES); + /* after handles the request, the thread flips the bit. */ + uint64_t request_done_bitmap QEMU_ALIGNED(SMP_CACHE_BYTES);Use DECLARE_BITMAP, otherwise you'll get type errors as David pointed out.
If we do it, the field becomes a pointer... that complicates the thing. Hmm, i am using the same trick applied by kvm module when it handles vcpu->requests: static inline bool kvm_test_request(int req, struct kvm_vcpu *vcpu) { return test_bit(req & KVM_REQUEST_MASK, (void *)&vcpu->requests); } Is it good?
[Prev in Thread] | Current Thread | [Next in Thread] |