From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C8B7F43C4D for ; Tue, 5 Mar 2024 10:05:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF901410DD; Tue, 5 Mar 2024 10:05:28 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9718A40E7C for ; Tue, 5 Mar 2024 10:05:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709629526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PEBfeZVlfG/543jLsPB7a7vy/LFKZnQV3K1Iboz76d8=; b=cSGrvX7yKN6L8h448fvKtW0mtc3GfD1saBW6RNnJfap/fzTRagX3/aY+bvHAfscDACq6CR MnVSxS0pgmYdMxUAeXHHpXhiWDNO9gzGeJ+R/o2M2ryHx1BUC705smTSDqJz2VUuzfN+2O BefQSHFj18RiqNUVhE/AUlZFJNJj8Ws= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-vjlzMHQjO1GTXvn9Gf4lWw-1; Tue, 05 Mar 2024 04:05:24 -0500 X-MC-Unique: vjlzMHQjO1GTXvn9Gf4lWw-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5131eb8137aso4585378e87.3 for ; Tue, 05 Mar 2024 01:05:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709629523; x=1710234323; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PEBfeZVlfG/543jLsPB7a7vy/LFKZnQV3K1Iboz76d8=; b=oDQB37rVsj86Qh/9JFzbAkdSAZbrrG1UkchT8IJzS/LvlDIU4cZyNS9afl8kdAdO4d A6D+Z2+FqyclEG2hC1GbbnL/lttdQPAMpMDEy97/lCPRxSk7s4mkK9Oqbgts45tUwEt/ hTe0w7TUeqs8TQzaeIk0T5ejXCa4TqLVtz6tkbKwvaKQ3VnSdOX17a6LB/SNEuFMvRCP CESe4O7/iADYRz1GCVUsZfoYtZfDc13dXnKRkuiYNdTl/9bzlh/R+5os+Jk1x59c58UK vPlfEdAeYPA+HR32ZWXsFUEvLrW4CHcnKaSOBFMuGeL+Hd9A16TZUPL4vvU9mtmEpDL9 3wig== X-Forwarded-Encrypted: i=1; AJvYcCVAycTuj12rJo0O1FSA1rPvkCE0FmrgYYaWWNhN1UQeuvtlz+i3c5u59/ZZBzQNdGZwJLjkXvN3rXj4JoKivYo= X-Gm-Message-State: AOJu0YzqrJtkM1eFyOHCqJcq6Uwljtic4d2omTVkd+S8u/oyyY/M2gMx B79cYiX6aO/j4TCzcQ8h4+nUrNNpaeZ6NEFTj+NaMipxb5/oXImjA/wnSx0c2xeiNucOIkmw5pH GzM87Gm9RD6RseldMMqLvQcybnuuiRJrcEC9WGvHK/JNywMHvCGia8ORPMEcGUhsxUWEyaDeIoH 56pW62MuHj8xQSPvf5pTk= X-Received: by 2002:a05:6512:230b:b0:513:45c3:c1d5 with SMTP id o11-20020a056512230b00b0051345c3c1d5mr1069099lfu.68.1709629523204; Tue, 05 Mar 2024 01:05:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFB11Jk/JGHfPy91kN2a+HSNy+AaAkqWjkdS9mJMfb8hXyxFwxGvwjVo623A6jLMBKXXP1oH5IiYSi0YCm/dDM= X-Received: by 2002:a05:6512:230b:b0:513:45c3:c1d5 with SMTP id o11-20020a056512230b00b0051345c3c1d5mr1069088lfu.68.1709629522891; Tue, 05 Mar 2024 01:05:22 -0800 (PST) MIME-Version: 1.0 References: <20240229122502.2572343-2-maxime.coquelin@redhat.com> <20240304103558.1500695-1-david.marchand@redhat.com> In-Reply-To: <20240304103558.1500695-1-david.marchand@redhat.com> From: David Marchand Date: Tue, 5 Mar 2024 10:05:10 +0100 Message-ID: Subject: Re: [PATCH v2] vhost: fix VDUSE device destruction failure To: David Marchand , Maxime Coquelin Cc: dev@dpdk.org, stable@dpdk.org, Chenbo Xia X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Mon, Mar 4, 2024 at 11:36=E2=80=AFAM David Marchand wrote: > > From: Maxime Coquelin > > VDUSE_DESTROY_DEVICE ioctl can fail because the device's > chardev is not released despite close syscall having been > called. It happens because the events handler thread is > still polling the file descriptor. > > fdset_pipe_notify() is not enough because it does not > ensure the notification has been handled by the event > thread, it just returns once the notification is sent. > > To fix this, this patch introduces a synchronization > mechanism based on pthread's condition, so that > fdset_pipe_notify_sync() only returns once the pipe's > read callback has been executed. > > Fixes: 51d018fdac4e ("vhost: add VDUSE events handler") > Cc: stable@dpdk.org > > Signed-off-by: Maxime Coquelin > Signed-off-by: David Marchand > --- > Changes since v1: > - sync'd only when in VDUSE destruction path, > - added explicit init of sync_mutex, Applied, thanks. --=20 David Marchand