Message ID | 20201012125323.17509-16-david@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | virtio-mem: Big Block Mode (BBM) | expand |
On 12.10.20 14:53, David Hildenbrand wrote: > Let's add some documentation for the current mode - Sub Block Mode (SBM) - > to prepare for a new mode - Big Block Mode (BBM). > > Follow-up patches will properly factor out the existing Sub Block Mode > (SBM) and implement Device Block Mode (DBM). s/Device Block Mode (DBM)/Big Block Mode (BBM)/
On Mon, Oct 12, 2020 at 02:53:09PM +0200, David Hildenbrand wrote: >Let's add some documentation for the current mode - Sub Block Mode (SBM) - >to prepare for a new mode - Big Block Mode (BBM). > >Follow-up patches will properly factor out the existing Sub Block Mode >(SBM) and implement Device Block Mode (DBM). > >Cc: "Michael S. Tsirkin" <mst@redhat.com> >Cc: Jason Wang <jasowang@redhat.com> >Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com> >Signed-off-by: David Hildenbrand <david@redhat.com> Reviewed-by: Wei Yang <richard.weiyang@linux.alibaba.com> >--- > drivers/virtio/virtio_mem.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > >diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c >index faeb759687fe..fd8685673fe4 100644 >--- a/drivers/virtio/virtio_mem.c >+++ b/drivers/virtio/virtio_mem.c >@@ -27,6 +27,21 @@ static bool unplug_online = true; > module_param(unplug_online, bool, 0644); > MODULE_PARM_DESC(unplug_online, "Try to unplug online memory"); > >+/* >+ * virtio-mem currently supports the following modes of operation: >+ * >+ * * Sub Block Mode (SBM): A Linux memory block spans 1..X subblocks (SB). The >+ * size of a Sub Block (SB) is determined based on the device block size, the >+ * pageblock size, and the maximum allocation granularity of the buddy. >+ * Subblocks within a Linux memory block might either be plugged or unplugged. >+ * Memory is added/removed to Linux MM in Linux memory block granularity. >+ * >+ * User space / core MM (auto onlining) is responsible for onlining added >+ * Linux memory blocks - and for selecting a zone. Linux Memory Blocks are >+ * always onlined separately, and all memory within a Linux memory block is >+ * onlined to the same zone - virtio-mem relies on this behavior. >+ */ >+ > enum virtio_mem_mb_state { > /* Unplugged, not added to Linux. Can be reused later. */ > VIRTIO_MEM_MB_STATE_UNUSED = 0, >-- >2.26.2
> > Let's add some documentation for the current mode - Sub Block Mode (SBM) - > > to prepare for a new mode - Big Block Mode (BBM). > > > > Follow-up patches will properly factor out the existing Sub Block Mode > > (SBM) and implement Device Block Mode (DBM). > > s/Device Block Mode (DBM)/Big Block Mode (BBM)/ > Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c index faeb759687fe..fd8685673fe4 100644 --- a/drivers/virtio/virtio_mem.c +++ b/drivers/virtio/virtio_mem.c @@ -27,6 +27,21 @@ static bool unplug_online = true; module_param(unplug_online, bool, 0644); MODULE_PARM_DESC(unplug_online, "Try to unplug online memory"); +/* + * virtio-mem currently supports the following modes of operation: + * + * * Sub Block Mode (SBM): A Linux memory block spans 1..X subblocks (SB). The + * size of a Sub Block (SB) is determined based on the device block size, the + * pageblock size, and the maximum allocation granularity of the buddy. + * Subblocks within a Linux memory block might either be plugged or unplugged. + * Memory is added/removed to Linux MM in Linux memory block granularity. + * + * User space / core MM (auto onlining) is responsible for onlining added + * Linux memory blocks - and for selecting a zone. Linux Memory Blocks are + * always onlined separately, and all memory within a Linux memory block is + * onlined to the same zone - virtio-mem relies on this behavior. + */ + enum virtio_mem_mb_state { /* Unplugged, not added to Linux. Can be reused later. */ VIRTIO_MEM_MB_STATE_UNUSED = 0,
Let's add some documentation for the current mode - Sub Block Mode (SBM) - to prepare for a new mode - Big Block Mode (BBM). Follow-up patches will properly factor out the existing Sub Block Mode (SBM) and implement Device Block Mode (DBM). Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com> Signed-off-by: David Hildenbrand <david@redhat.com> --- drivers/virtio/virtio_mem.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)