From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 C80CE1FE47F for ; Wed, 8 Jan 2025 16:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736353643; cv=none; b=D5gGtLGz2+Xl5xHgVquJL0o4iIHKyTrF1IhJC2GFylG2OWehwQ7zSH06yIiMgbxhNMki4X2bdYUkq2CFMSyT3Uhd0gccaA6JtZxmmW0VfskiuH60aZbH7KCfqnvAYCwVd6z+UvW3VSfV/xcNY4LNq1tctHw+ikMso8KGGFjZjMA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736353643; c=relaxed/simple; bh=UeZsfVI8/f4Y/+CVrzTXum3t7UqvjAFMBTCCCz9jcQ0=; h=From:Message-ID:Date:MIME-Version:Subject:To:Cc:References: In-Reply-To:Content-Type; b=qpHN3H56MSUfWqL3IqE6Fi+CioLak22OEuWlYcMeuwblianp/a7sZMJJ7yBAyY8anicELBWYURQJeEbZIMO9agCRCTqJOnxOnQ+FjbGhfL9B9Ly91tN1kaskq1PW0lpPrPB3KDSzSK8wRbAf0XiITsubiiRUEDoIl1M8ju8jWRM= 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=OgNuX8JA; arc=none smtp.client-ip=170.10.133.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OgNuX8JA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736353640; 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=fkpeSCEukM6iBxe9HuNrhpoVSaHBXeUot4e0FpvqthU=; b=OgNuX8JAvHwEWeGoHoA9R1bco8aKZjAkUbjQBGvy4NTHSWCiYKS3sN/JP5hbuzcG/y74SL Rz8wyjGK+zIzUm0xGZjLqvQMH+3N+9OL/Xqw1xeYY0iHvWLZh1cReCtXKXvKE+9PRvfq7S dDusnltPTWPpSeiGv66zrT80atGkdgI= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-4JaU5WjAPjeeIclEMaLsqA-1; Wed, 08 Jan 2025 11:27:17 -0500 X-MC-Unique: 4JaU5WjAPjeeIclEMaLsqA-1 X-Mimecast-MFC-AGG-ID: 4JaU5WjAPjeeIclEMaLsqA Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4679becb47eso130016501cf.3 for ; Wed, 08 Jan 2025 08:27:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736353637; x=1736958437; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fkpeSCEukM6iBxe9HuNrhpoVSaHBXeUot4e0FpvqthU=; b=c4ITyiiQVBQ7lNOYGdJxvqGvOVjlgPVc6ZcOpJ197yRwntFrK5Eej/wTroxnaHyFWM DSLT/Kf+nCUd9WHzBqhRXCnzPwhIGnsJFAF+CuFMMZqtLr048xrc9w4WAjtr8GiIKq22 pnHkR21Iwoe8MAlj/Z2QlMJfdzjkGD/So2lE7PjbUxRdMxIVzvFUN8ZET17Nb/MUKLih Xc4fm9DdyIHR8NZ/tgh0PkGb1Y2bKPbGJY5xINH1f6iKq49TkSt8lc4hJ2F8twKM1n1r DRaZ1Yz9kJE0+77HZRhmQJoMcnZ/WQJgsLUI7hoOLVMex2f9b0R4iffs3JU+YRGqBtiv rQtA== X-Forwarded-Encrypted: i=1; AJvYcCXurC/7tSctJCHGUaX4VRrcV5odKk8OfhbDIyOh064rF0ixbKDuPZ9e/MQQYw7oKZA4DVxeQGTLG7DC0mY=@vger.kernel.org X-Gm-Message-State: AOJu0YyMp2gzBLt1nTOp/1sK7RtRE2eWKXusNTcwB2VmPbGtUIcWHa6O Rk6Htiq6nTWJIcn6nNlW/FdvTE5ySPLpVuwJJs3dHsGiFam31pVSZ3n8wcrj/4C6/CmUAbMYzrB m32NeNeQnr9suiSctbqdm/+GLl6Vn9vT9yZUh3dDEg9SERVcYbdkYhOT1iABrzw== X-Gm-Gg: ASbGnctVJruDfOvYHxJftsgxNCMCsDyxqy12LscuEyumC2UDheDPH9Vm0ti2BE6Ad5/ dkS7G44ZBzDgEpFQst6QdVOEOoGhZVVjTHZRQETRfklJ1IK+hm9lhFpqUh7Ko9tQrsRUGyZoi8r 86ItybFE/uYvg6pPn5Aoip2MylvZHPeaaZa1X3J55N6pVIuzIgydH4efoQEgPL2/OS4g+iFJcHn qCxiKbmKWN2wcRwKd6HYjKHinj3dcA/w10Nnl3xu2VspUakTXK4yXT6gSkYuQG/1APydQyoMr/T 76aIyduHe7nkxawh9Jb+pjO5 X-Received: by 2002:a05:620a:e94:b0:7bc:dc89:36f6 with SMTP id af79cd13be357-7bcdc893c87mr237291685a.60.1736353636995; Wed, 08 Jan 2025 08:27:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzvJ7DjCBIgpCPTr80qYxvGrfJg2NprZNP0WFoAZXTXH0Yn907zsYfu8LUYE21bnpl0WG3wg== X-Received: by 2002:a05:620a:e94:b0:7bc:dc89:36f6 with SMTP id af79cd13be357-7bcdc893c87mr237278085a.60.1736353635245; Wed, 08 Jan 2025 08:27:15 -0800 (PST) Received: from ?IPV6:2601:188:ca00:a00:f844:fad5:7984:7bd7? ([2601:188:ca00:a00:f844:fad5:7984:7bd7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac478df8sm1693634085a.81.2025.01.08.08.27.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jan 2025 08:27:14 -0800 (PST) From: Waiman Long X-Google-Original-From: Waiman Long Message-ID: <2eaf52fb-b7d4-4024-a671-02d5375fca22@redhat.com> Date: Wed, 8 Jan 2025 11:27:12 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next v1 12/22] rqspinlock: Add basic support for CONFIG_PARAVIRT To: Kumar Kartikeya Dwivedi , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Torvalds , Peter Zijlstra , Waiman Long , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Eduard Zingerman , "Paul E. McKenney" , Tejun Heo , Barret Rhoden , Josh Don , Dohyun Kim , kernel-team@meta.com References: <20250107140004.2732830-1-memxor@gmail.com> <20250107140004.2732830-13-memxor@gmail.com> Content-Language: en-US In-Reply-To: <20250107140004.2732830-13-memxor@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/7/25 8:59 AM, Kumar Kartikeya Dwivedi wrote: > We ripped out PV and virtualization related bits from rqspinlock in an > earlier commit, however, a fair lock performs poorly within a virtual > machine when the lock holder is preempted. As such, retain the > virt_spin_lock fallback to test and set lock, but with timeout and > deadlock detection. > > We don't integrate support for CONFIG_PARAVIRT_SPINLOCKS yet, as that > requires more involved algorithmic changes and introduces more > complexity. It can be done when the need arises in the future. virt_spin_lock() doesn't scale well. It is for hypervisors that don't support PV qspinlock yet. Now rqspinlock() will be in this category. I wonder if we should provide an option to disable rqspinlock and fall back to the regular qspinlock with strict BPF locking semantics. Another question that I have is about PREEMPT_RT kernel which cannot tolerate any locking stall. That will probably require disabling rqspinlock if CONFIG_PREEMPT_RT is enabled. Cheers, Longman