On 2020/10/12 下午2:59, Eli Cohen wrote:
On Fri, Oct 09, 2020 at 11:56:45AM +0800, Jason Wang wrote:
On 2020/10/1 下午9:29, Eli Cohen wrote:
On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote:
This patch introduces a new bus operation to allow the vDPA bus driver
to associate an ASID to
Let's determine the target nid only once in case we have none specified -
usually, we'll end up with node 0 either way.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 28 +++-
1 file changed,
Avoid using memory block ids. While at it, use uint64_t for
address/size.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git
No longer used, let's drop it.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 4
1 file changed, 4 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c b/drivers/virtio/virtio_mem.c
index
virtio-mem currently only supports device block sizes that span at most
a single Linux memory block. For example, gigantic pages in the hypervisor
result on x86-64 in a device block size of 1 GiB - when the Linux memory
block size is 128 MiB, we cannot support such devices (we fail loading the
Let's use pageblock_nr_pages and MAX_ORDER_NR_PAGES instead where
possible, so we don't have do deal with allocation orders.
Add a comment why we have that restriction for now.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
We actually need one byte less (next_mb_id is exclusive, first_mb_id is
inclusive). Simplify.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
Let's check by traversing busy system RAM resources instead, to avoid
relying on memory block states.
Don't use walk_system_ram_range(), as that works on pages and we want to
use the bare addresses we have easily at hand.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by:
We can drop rc2, we don't actually need the value.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c
Let's try to unplug completely offline big blocks first. Then, (if
enabled via unplug_offline) try to offline and remove whole big blocks.
No locking necessary - we can deal with concurrent onlining/offlining
just fine.
Note1: This is sub-optimal and might be dangerous in some environments: we
Currently, we do not support device block sizes that exceed the Linux
memory block size. For example, having a device block size of 1 GiB (e.g.,
gigantic pages in the hypervisor) won't work with 128 MiB Linux memory
blocks.
Let's implement Big Block Mode (BBM), whereby we add/remove at least
one
Let's allow to force BBM, even if subblocks would be possible. Take care
of properly calculating the first big block id, because the start
address might no longer be aligned to the big block size.
Also, allow to manually configure the size of Big Blocks.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Let's rename accordingly.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 29 +++--
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c
Let's move first_mb_id/next_mb_id/last_usable_mb_id accordingly.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 44 ++---
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git
Let's rename to "sbs_per_mb" and "sb_size" and move accordingly.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 96 ++---
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git
virtio-mem soon wants to use offline_and_remove_memory() memory that
exceeds a single Linux memory block (memory_block_size_bytes()). Let's
remove that restriction.
Let's remember the old state and try to restore that if anything goes
wrong. While re-onlining can, in general, fail, it's highly
Let's move the existing dev_dbg() into the functions, print if something
went wrong, and also print for virtio_mem_send_unplug_all_request().
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 50
Let's use wrappers for the low-level functions that dev_dbg/dev_warn
and work on addr + size, such that we can reuse them for adding/removing
in other granularity.
We only warn when adding memory failed, because that's something to pay
attention to. We won't warn when removing failed, we'll reuse
Let's add a safe mechanism to unplug memory, avoiding long/endless loops
when trying to offline memory - similar to in SBM.
Fake-offline all memory (via alloc_contig_range()) before trying to
offline+remove it. Use this mode as default, but allow to enable the other
mode explicitly (which could
No harm done, but let's be consistent.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/virtio/virtio_mem.c
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"
Cc: Jason Wang
Cc: Pankaj
ZONE_MOVABLE is supposed to give some guarantees, yet,
alloc_contig_range() isn't prepared to properly deal with some racy
cases properly (e.g., temporary page pinning when exiting processed, PCP).
Retry 5 times for now. There is certainly room for improvement in the
future.
Cc: "Michael S.
Let's factor out the core pieces and place the implementation next to
virtio_mem_fake_offline(). We'll reuse this functionality soon.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 73
We don't want to add too much memory when it's not getting onlined
immediately, to avoid running OOM. Generalize the handling, to avoid
making use of memory block states. Use a threshold of 1 GiB for now.
Properly adjust the offline size when adding/removing memory. As we are
not always protected
let's use a new "sbm" sub-struct to hold SBM-specific state and rename +
move applicable definitions, frunctions, and variables (related to
memory block states).
While at it:
- Drop the "_STATE" part from memory block states
- Rename "nb_mb_state" to "mb_count"
- "set_mb_state" / "get_mb_state"
Let's rename and move accordingly. While at it, rename sb_bitmap to
"sb_states".
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 118 +++-
1 file changed, 62 insertions(+), 56
Let's rename them accordingly. virtio_mem_plug_request() and
virtio_mem_unplug_request() will be handled separately.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 90 ++---
1 file
The calculation is already complicated enough, let's limit it to one
location.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 20 +++-
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git
Avoid using memory block ids. Rename it to virtio_mem_contains_range().
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git
Let's trigger from offlining code when we're not allowed to touch online
memory.
Handle the other case (memmap possibly freeing up another memory block)
when actually removing memory. When removing via virtio_mem_remove(),
virtio_mem_retry() is a NOP and safe to use.
While at it, move retry
... which now matches virtio_mem_fake_online(). We'll reuse this
functionality soon.
Cc: "Michael S. Tsirkin"
Cc: Jason Wang
Cc: Pankaj Gupta
Signed-off-by: David Hildenbrand
---
drivers/virtio/virtio_mem.c | 34 --
1 file changed, 24 insertions(+), 10
On Sun, Oct 11, 2020 at 10:03 PM wrote:
>
> From: Tonghao Zhang
>
> Allow user configuring RXCSUM separately with ethtool -K,
> reusing the existing virtnet_set_guest_offloads helper
> that configures RXCSUM for XDP. This is conditional on
> VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.
>
> If Rx checksum
On 10/12/20 10:39 AM, Muchun Song wrote:
> On Mon, Oct 12, 2020 at 3:42 PM Eric Dumazet wrote:
>>
>> On Mon, Oct 12, 2020 at 6:22 AM Muchun Song wrote:
>>>
>>> On Mon, Oct 12, 2020 at 2:39 AM Cong Wang wrote:
On Sat, Oct 10, 2020 at 3:39 AM Muchun Song
wrote:
>
> The
From: Mike Christie
[ Upstream commit 37787e9f81e2e586b526ff5c29c94e4f41513e80 ]
We must free the vqs array in the open failure path, because
vhost_vdpa_release will not be called.
Signed-off-by: Mike Christie
Link:
There is import_uuid() function which imports u8 array to the uuid_t.
Use it instead of open coding variant.
This allows to hide the uuid_t internals.
Signed-off-by: Andy Shevchenko
---
drivers/gpu/drm/virtio/virtgpu_vq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
On Mon, Oct 12, 2020 at 2:53 AM Muchun Song wrote:
> We are not complaining about TCP using too much memory, but how do
> we know that TCP uses a lot of memory. When I firstly face this problem,
> I do not know who uses the 25GB memory and it is not shown in the
> /proc/meminfo.
> If we can know
On Sun, Oct 11, 2020 at 9:22 PM Muchun Song wrote:
>
> On Mon, Oct 12, 2020 at 2:39 AM Cong Wang wrote:
> >
> > On Sat, Oct 10, 2020 at 3:39 AM Muchun Song
> > wrote:
> > >
> > > The amount of memory allocated to sockets buffer can become significant.
> > > However, we do not display the
On 2020/10/12 下午4:17, Eli Cohen wrote:
On Mon, Oct 12, 2020 at 03:45:10PM +0800, Jason Wang wrote:
So in theory we can have several asid's (for different virtqueues), each
one should be followed by a specific set_map call. If this is so, how do
I know if I met all the conditions run my driver?
On 2020/9/9 下午1:30, Eli Cohen wrote:
On Tue, Sep 08, 2020 at 10:08:39PM -0400, Jason Wang wrote:
- Original Message -
set_map() is used by mlx5 vdpa to create a memory region based on the
address map passed by the iotlb argument. If we get successive calls, we
will destroy the
39 matches
Mail list logo