Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2306358rdb; Mon, 5 Feb 2024 02:20:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF4/IbF+CqKdXN7EZbdQy9dNBrwE61uYv4ZqHxxpFsCzD0JDFsQZGyDS1QlyZ6HKuKcs8N9 X-Received: by 2002:a05:6358:8a5:b0:176:91bb:9600 with SMTP id m37-20020a05635808a500b0017691bb9600mr18756211rwj.3.1707128431996; Mon, 05 Feb 2024 02:20:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707128431; cv=pass; d=google.com; s=arc-20160816; b=i8+xS5SUo9ZPUsKFG56KHWUK3tQm8iXN1LUvA3eXIhTTfB/JXVONSFviBweBJNiBoj kZ/rxk5h/ifWkaU3PTCnpOLSKu8+6zRUmfSWPXC6V3st9AWfGcICZJWAX33bAfraGMzZ 86emRebU4grNi05f/hhk8/A3fQkGBX95BvzFe/LoVYZ//K6GhTw2Ng9XMw8eYPovExS7 scGcA4ykO/ysCm8DMxOFBGNYHWrIy+cQRfftzaLeWYv1OnMwX0TjsGqx1l2sdlFGREZg f9ARqGPzr+pFM5S9rZbsAOieRXqqzRxe6MW0gt3FJb20vB0GzeSx1JapcQjdURAamD5n bd0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jI4PbEn5bcHDGLMbu+52VQdT8MjOytUlCwJj0kXdfq0=; fh=f4nsmrNqyFttr2486o1XGjw3oK7oSkDyzfVj1hl+FjA=; b=iXpDv/6smq0s3ctMuUwZHWaOkRVcVJ5JiDx0xoReD4OCGP9i7hRKuV1kqu63tiju4q Oxy82WcsZbh+L8XvpV8zmh37t/6V5WSxm3kTqUgAwfaKPRP+NkS48j8L+xgn7kj+Fs9M piZMMwOK2z0C7UrMxAS0+ADkKjJnDGdPBA5GWQDK5FRmoWROeL4N3w6+kma9Avszfkox kTDvc9HG/fHdtKC8JdzjtBMiPMYDzAWNxthmuC++d9AzKxpKWbHEH5oBLxeRQfkJhOjm 43ZYxSFPCUjAgmCz9ALwi1a46Ud6UioPK/vjw06JSpOScdVTTmiP4RtG6PCnx/ynLv1X o8ig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LdfaQyjQ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-52379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=1; AJvYcCW7B1c8mzhO6Lzw8JFQOSpHopU2SodfwldjZiaATiS3U46VhcTm8ck+2Nzo477Nr+igIDtvfS/dZbUgY+nr4k4YtIB6zBccrAjiu/3pXg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j9-20020a056a00234900b006dda11eb6fesi6072996pfj.11.2024.02.05.02.20.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:20:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LdfaQyjQ; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-52379-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52379-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AADE82904D8 for ; Mon, 5 Feb 2024 10:05:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53DD214276; Mon, 5 Feb 2024 10:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LdfaQyjQ" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 261CA14AA8 for ; Mon, 5 Feb 2024 10:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127522; cv=none; b=FCWaGzxIJCBorTgot7+r8NrWGGjwl4pp6s6Crx50qqbvnxUmYDXmt0ZDX0QbOvmd7vP2HkOP1iWIunVPykneh8ZRrlAvijgQ8rWhE6lSzxYWsAmkxKpOnJtyBkV10klOexn4iFN8iSXRVmqQrQDbxK28urS5A6L+QxapPdtqL3w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707127522; c=relaxed/simple; bh=FvTH7ce4HO+MqDVbYAWd4QDxi89r1l2keNPhU6hTSXw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oGRAps3MKbF3Y7jBNH2/nQho+zbDjGQBnHXvD8LGLy10FVuVZPX3EVDAzGO7Kegn6gZOPAU3KNuJ9YqQszw24aa3Ljh2dOXk8YqBkizhHse5+TDON7Eu4Qub0lliN1ljKnufzduZu6BaW51yGqGjinFXUDVNpB4PtvhAVwioXhM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=LdfaQyjQ; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707127519; 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: in-reply-to:in-reply-to:references:references; bh=jI4PbEn5bcHDGLMbu+52VQdT8MjOytUlCwJj0kXdfq0=; b=LdfaQyjQ2tjeTAD4jBwlS6F8npxJEMVmBc43zZcIl9TdKUw119fQXCUY2XZB8snp8pQ8C6 KDwSdKrb2HFTOVvIJf49gMrvGimRoBy4+UyQtO/a9jW/HUDjqwieypKltbToOJLbcrH0HI KQtWOiIe2bxYgBKmgEf+0WHWHUIGniU= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-vi-6BneTMeK4eK95wM457A-1; Mon, 05 Feb 2024 05:05:18 -0500 X-MC-Unique: vi-6BneTMeK4eK95wM457A-1 Received: by mail-oo1-f72.google.com with SMTP id 006d021491bc7-59a1c8f2f98so868445eaf.1 for ; Mon, 05 Feb 2024 02:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707127517; x=1707732317; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jI4PbEn5bcHDGLMbu+52VQdT8MjOytUlCwJj0kXdfq0=; b=gq7ATkQgdFqGowPS8aTRDoUgVGa/upcBwKVQKBXiULd/DS5KLpQq66AlqFoaXTxl4h 0Iw3H6OFShEq5pF5BXP7PYY4ByR4Q8Nyv4gwsL/pzX9w95FzkIIQzpuCSkm2bMP91NEx 4xaA30rMGTKE8rURBzzmghC+WjjDmnFqXAUt639AiPFo24EMi/hQW325jefA8WmZ3SfR n4JDC/KrjaZUVn48/dsid2VTAZIJX5VcHxxIcatblJLK6V9xnl2s2FDEmX4OIS5bTWCF kH4n7ShxlfUhesWVb0QHfBzpUS1NV+rscGDSmscDLzxJK3gscMZBcIRU6M8gjMGCnw+5 rNKQ== X-Gm-Message-State: AOJu0YwEbqilY6J28vx4n+0oaF/r7NeyEG67YLvTAHSMH2N1F9vPatvB 1PW1hPFu7Co/W4xctwQgpouR7utJ1C5Zl9qLcIqgYcl+Teo/1PDzHuDpsrOQHtxh59Vgbq7iFRY qjJyqNua9HZ0IlmEHRdORRAYRrOk6AmRfFDBa9IEoweVCcxh+Gq9R5pgc5W+iGw== X-Received: by 2002:a05:6358:7f05:b0:178:8c44:aa8b with SMTP id p5-20020a0563587f0500b001788c44aa8bmr11609006rwn.3.1707127517662; Mon, 05 Feb 2024 02:05:17 -0800 (PST) X-Received: by 2002:a05:6358:7f05:b0:178:8c44:aa8b with SMTP id p5-20020a0563587f0500b001788c44aa8bmr11608992rwn.3.1707127517378; Mon, 05 Feb 2024 02:05:17 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWoh+GzuRpjT9/ChYsEcK+q66hd4k8A3L/hx8CrGu0JVnDMkwpxykxZvzLQm56gLNHyyW2QTFnYegJxMsbcIVEXxSfXKKkWFO2nSjmi1/GPommUPYVDwDhPiiERdZpNku0MKXfJPD+LZq3Huot7R9CzYHxOgBN/+jWfnVymDFMMLyV3b2ftw/Z9fst/RoIahjBqxzjK59flIllJIPhksB8/CkqDPhUVsg== Received: from x1n ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id r9-20020aa78449000000b006e050c8f22bsm230160pfn.207.2024.02.05.02.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 02:05:16 -0800 (PST) Date: Mon, 5 Feb 2024 18:05:02 +0800 From: Peter Xu To: Shaoqin Huang Cc: Paolo Bonzini , Sean Christopherson , Shuah Khan , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] KVM: selftests: Fix the dirty_log_test semaphore imbalance Message-ID: References: <20240202064332.9403-1-shahuang@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240202064332.9403-1-shahuang@redhat.com> Shaoqin, Sean, Apologies for a late comment. I'm trying to remember what I wrote.. On Fri, Feb 02, 2024 at 01:43:32AM -0500, Shaoqin Huang wrote: > Why sem_vcpu_cont and sem_vcpu_stop can be non-zero value? It's because > the dirty_ring_before_vcpu_join() execute the sem_post(&sem_vcpu_cont) > at the end of each dirty-ring test. It can cause two cases: As a possible alternative, would it work if we simply reset all the sems for each run? Then we don't care about the leftovers. E.g. sem_destroy() at the end of run_test(), then always init to 0 at entry. -- Peter Xu