Re: [PATCH net-next 1/5] virtio_net: Fix an unsafe reference to the page chain

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:16 PM Michael S. Tsirkin wrote: > > On Fri, May 26, 2023 at 01:46:17PM +0800, Liang Chen wrote: > > "private" of buffer page is currently used for big mode to chain pages. > > But in mergeable mode, that offset of page could mean something else, > > e.g. when page_pool

Re: [PATCH net-next 1/5] virtio_net: Fix an unsafe reference to the page chain

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:29 PM Michael S. Tsirkin wrote: > > On Fri, May 26, 2023 at 02:38:54PM +0800, Jason Wang wrote: > > On Fri, May 26, 2023 at 1:46 PM Liang Chen > > wrote: > > > > > > "private" of buffer page is currently used for big mode to chain pages. > > > But in mergeable mode,

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27, 2023 at 02:15:42AM +0800, Zhu Lingshan wrote: Current virtio-net only probes a device with VIRITO_ID_NET == 1. For a modern-transtional virtio-net device which has a transtional device id 0x1000 and acts as a modern device,

Re: [PATCH net-next 3/5] virtio_net: Add page pool fragmentation support

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:25 PM Michael S. Tsirkin wrote: > > On Fri, May 26, 2023 at 01:46:19PM +0800, Liang Chen wrote: > > To further enhance performance, implement page pool fragmentation > > support and introduce a module parameter to enable or disable it. > > > > In single-core vm testing

Re: [PATCH net-next 3/5] virtio_net: Add page pool fragmentation support

2023-05-29 Thread Liang Chen
On Mon, May 29, 2023 at 9:33 AM Yunsheng Lin wrote: > > On 2023/5/26 13:46, Liang Chen wrote: > > ... > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index 99c0ca0c1781..ac40b8c66c59 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: > > > On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: > > On Sat, May 27, 2023 at 02:15:42AM +0800, Zhu Lingshan wrote: > > > Current virtio-net only probes a device with VIRITO_ID_NET == 1. > > > > > > For a modern-transtional

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27, 2023 at 02:15:42AM +0800, Zhu Lingshan wrote: Current virtio-net only probes a device with VIRITO_ID_NET == 1.

Re: [PATCH net-next 2/5] virtio_net: Add page_pool support to improve performance

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:20 PM Michael S. Tsirkin wrote: > > On Fri, May 26, 2023 at 01:46:18PM +0800, Liang Chen wrote: > > The implementation at the moment uses one page per packet in both the > > normal and XDP path. In addition, introducing a module parameter to enable > > or disable the

Re: [PATCH net-next 2/5] virtio_net: Add page_pool support to improve performance

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:27 PM Michael S. Tsirkin wrote: > > On Sat, May 27, 2023 at 12:11:25AM +0800, kernel test robot wrote: > > Hi Liang, > > > > kernel test robot noticed the following build errors: > > > > [auto build test ERROR on net-next/main] > > > > url: > >

Re: [PATCH net-next 2/5] virtio_net: Add page_pool support to improve performance

2023-05-29 Thread Liang Chen
On Sun, May 28, 2023 at 2:40 PM Michael S. Tsirkin wrote: > > On Sat, May 27, 2023 at 08:35:01PM +0800, Liang Chen wrote: > > On Fri, May 26, 2023 at 2:51 PM Jason Wang wrote: > > > > > > On Fri, May 26, 2023 at 1:46 PM Liang Chen > > > wrote: > > > > > > > > The implementation at the moment

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 09:13:09PM +0800, Zhu, Lingshan wrote: > > > On 5/29/2023 8:04 PM, Michael S. Tsirkin wrote: > > On Mon, May 29, 2023 at 06:41:54PM +0800, Zhu, Lingshan wrote: > > > > > > On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: > > > > > > On Mon, May 29, 2023 at

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread michael . christie
On 5/29/23 6:19 AM, Oleg Nesterov wrote: > If we want CLONE_THREAD, I think vhost_worker() should exit after get_signal() > returns SIGKILL. Perhaps it should "disable" vhost_work_queue() somehow and > flush the pending works on ->work_list before exit, I dunno. But imo it should > not wait for

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Mike Christie
On 5/29/23 12:46 PM, Oleg Nesterov wrote: > Mike, sorry, I don't understand your email. > > Just in case, let me remind I know nothing about drivers/vhost/ > No problem. I get it. I don't know the signal/thread code so it's one of those things where I'm also learning as I go. > On 05/29,

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Oleg Nesterov
Mike, sorry, I don't understand your email. Just in case, let me remind I know nothing about drivers/vhost/ On 05/29, michael.chris...@oracle.com wrote: > > On 5/29/23 6:19 AM, Oleg Nesterov wrote: > > On 05/27, Eric W. Biederman wrote: > >> > >> Looking forward I don't see not asking the worker

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Oleg Nesterov
On 05/29, Oleg Nesterov wrote: > > Mike, sorry, I don't understand your email. > > Just in case, let me remind I know nothing about drivers/vhost/ And... this is slightly off-topic but you didn't answer my previous question and I am just curious. Do you agree that, even if we forget about

Re: [PATCH net-next 2/5] virtio_net: Add page_pool support to improve performance

2023-05-29 Thread Liang Chen
On Mon, May 29, 2023 at 5:55 PM Michael S. Tsirkin wrote: > > On Mon, May 29, 2023 at 03:27:56PM +0800, Liang Chen wrote: > > On Sun, May 28, 2023 at 2:20 PM Michael S. Tsirkin wrote: > > > > > > On Fri, May 26, 2023 at 01:46:18PM +0800, Liang Chen wrote: > > > > The implementation at the moment

[PATCH v1] virtio-pci: Improve code style for including header files

2023-05-29 Thread Feng Liu via Virtualization
Fix code style related to including header file. Include header files before declaring macro definitions to avoid conflicts. Signed-off-by: Feng Liu Reviewed-by: Jiri Pirko --- drivers/virtio/virtio_pci_modern.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Mike Christie
On 5/29/23 12:54 PM, Oleg Nesterov wrote: > On 05/29, Oleg Nesterov wrote: >> >> Mike, sorry, I don't understand your email. >> >> Just in case, let me remind I know nothing about drivers/vhost/ > > And... this is slightly off-topic but you didn't answer my previous > question and I am just

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread michael . christie
On 5/29/23 2:35 PM, Mike Christie wrote: >> Hmm... If we you CLONE_THREAD the exiting vhost_worker() will auto-reap >> itself, > Oh wait, are you saying that when we get auto-reaped then we would do the last > fput and call the file_operations->release function right? We actually set >

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Oleg Nesterov
On 05/27, Eric W. Biederman wrote: > > Looking forward I don't see not asking the worker threads to stop > for the coredump right now causing any problems in the future. > So I think we can use this to resolve the coredump issue I spotted. But we have almost the same problem with exec. Execing

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27,

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 06:41:54PM +0800, Zhu, Lingshan wrote: > > > On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: > > On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: > > > On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: > > On Mon, May 29, 2023 at

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: > > > On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: > > On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: > > > > > > On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: > > > > On Sat, May 27, 2023 at 02:15:42AM +0800,

Re: [PATCH net-next 2/5] virtio_net: Add page_pool support to improve performance

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 03:27:56PM +0800, Liang Chen wrote: > On Sun, May 28, 2023 at 2:20 PM Michael S. Tsirkin wrote: > > > > On Fri, May 26, 2023 at 01:46:18PM +0800, Liang Chen wrote: > > > The implementation at the moment uses one page per packet in both the > > > normal and XDP path. In

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 8:04 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 06:41:54PM +0800, Zhu, Lingshan wrote: On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote:

Re: [PATCH] scsi: virtio_scsi: Remove a useless function call

2023-05-29 Thread Paolo Bonzini
On 5/29/23 09:35, Christophe JAILLET wrote: 'inq_result' is known to be NULL. There is no point calling kfree(). Signed-off-by: Christophe JAILLET --- drivers/scsi/virtio_scsi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c

Re: [PATCH] scsi: virtio_scsi: Remove a useless function call

2023-05-29 Thread Stefan Hajnoczi
On Mon, May 29, 2023 at 09:35:08AM +0200, Christophe JAILLET wrote: > 'inq_result' is known to be NULL. There is no point calling kfree(). > > Signed-off-by: Christophe JAILLET > --- > drivers/scsi/virtio_scsi.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Stefan

Re: [PATCH] virtio_ring: validate used buffer length

2023-05-29 Thread Michael S. Tsirkin
On Mon, May 29, 2023 at 09:18:10AM +0800, Jason Wang wrote: > On Sun, May 28, 2023 at 3:57 PM Michael S. Tsirkin wrote: > > > > On Fri, May 26, 2023 at 02:30:41PM +0800, Jason Wang wrote: > > > This patch validate > > > > validates > > > > > the used buffer length provided by the device > > >

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread michael . christie
On 5/29/23 6:19 AM, Oleg Nesterov wrote: > On 05/27, Eric W. Biederman wrote: >> >> Looking forward I don't see not asking the worker threads to stop >> for the coredump right now causing any problems in the future. >> So I think we can use this to resolve the coredump issue I spotted. > > But we

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Eric W. Biederman
michael.chris...@oracle.com writes: > On 5/29/23 2:35 PM, Mike Christie wrote: >>> Hmm... If we you CLONE_THREAD the exiting vhost_worker() will auto-reap >>> itself, >> Oh wait, are you saying that when we get auto-reaped then we would do the >> last >> fput and call the

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-05-29 Thread Eric W. Biederman
michael.chris...@oracle.com writes: > On 5/29/23 6:19 AM, Oleg Nesterov wrote: >> On 05/27, Eric W. Biederman wrote: >>> >>> Looking forward I don't see not asking the worker threads to stop >>> for the coredump right now causing any problems in the future. >>> So I think we can use this to