[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations
From: |
Tetsuo Handa |
Subject: |
Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations |
Date: |
Sat, 16 Dec 2017 20:28:04 +0900 |
Wei Wang wrote:
> On 12/16/2017 02:42 AM, Matthew Wilcox wrote:
> > On Tue, Dec 12, 2017 at 07:55:55PM +0800, Wei Wang wrote:
> >> +int xb_preload_and_set_bit(struct xb *xb, unsigned long bit, gfp_t gfp);
> > I'm struggling to understand when one would use this. The xb_ API
> > requires you to handle your own locking. But specifying GFP flags
> > here implies you can sleep. So ... um ... there's no locking?
>
> In the regular use cases, people would do xb_preload() before taking the
> lock, and the xb_set/clear within the lock.
>
> In the virtio-balloon usage, we have a large number of bits to set with
> the balloon_lock being held (we're not unlocking for each bit), so we
> used the above wrapper to do preload and set within the balloon_lock,
> and passed in GFP_NOWAIT to avoid sleeping. Probably we can change to
> put this wrapper implementation to virtio-balloon, since it would not be
> useful for the regular cases.
GFP_NOWAIT is chosen in order not to try to OOM-kill something, isn't it?
But passing GFP_NOWAIT means that we can handle allocation failure. There is
no need to use preload approach when we can handle allocation failure.
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, (continued)
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/15
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/15
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wang, Wei W, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wei Wang, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wei Wang, 2017/12/16
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/14
Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Matthew Wilcox, 2017/12/15
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wei Wang, 2017/12/16
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations,
Tetsuo Handa <=
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wei Wang, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Tetsuo Handa, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wang, Wei W, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Tetsuo Handa, 2017/12/17
- Re: [Qemu-devel] [PATCH v19 3/7] xbitmap: add more operations, Wei Wang, 2017/12/18
[Qemu-devel] [PATCH v19 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG, Wei Wang, 2017/12/12
[Qemu-devel] [PATCH v19 5/7] mm: support reporting free page blocks, Wei Wang, 2017/12/12
[Qemu-devel] [PATCH v19 6/7] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ, Wei Wang, 2017/12/12
[Qemu-devel] [PATCH v19 7/7] virtio-balloon: don't report free pages when page poisoning is enabled, Wei Wang, 2017/12/12