From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C6F7C43334 for ; Wed, 6 Jul 2022 13:36:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232512AbiGFNgB (ORCPT ); Wed, 6 Jul 2022 09:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbiGFNgA (ORCPT ); Wed, 6 Jul 2022 09:36:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CDB5A5F66 for ; Wed, 6 Jul 2022 06:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657114558; 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=X/WSNz/O/rseR8ionnlRznfb5hq7WNGNhQFdrjMBEzs=; b=UP/bwp+pXA8G1xikyoxdhUpcdGhABm26UwpyjhvXNb3mD5/HXCAcfNCyk6dtRO3tLbtfh4 OigWMlc2U4zna41nUZMVa35FbBckZvybivuNcMXR18q9HOQlvbk0D89Q6RwsYFT830aQXx eYXhwDGpm1jHIXBwLZ9A8aw4jjfTBRI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-478-aLsXVjpKPuyDkby57IeVHQ-1; Wed, 06 Jul 2022 09:35:49 -0400 X-MC-Unique: aLsXVjpKPuyDkby57IeVHQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CEF780D3C0; Wed, 6 Jul 2022 13:35:49 +0000 (UTC) Received: from [10.22.8.95] (unknown [10.22.8.95]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B51CC28129; Wed, 6 Jul 2022 13:35:49 +0000 (UTC) Message-ID: <7e1a7093-2dbd-e5aa-3fae-9ade787cbd41@redhat.com> Date: Wed, 6 Jul 2022 09:35:48 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 06/13] locking/qspinlock: merge qspinlock_paravirt.h into qspinlock.c Content-Language: en-US To: Peter Zijlstra , Nicholas Piggin Cc: Ingo Molnar , Will Deacon , Boqun Feng , linux-kernel@vger.kernel.org References: <20220704143820.3071004-1-npiggin@gmail.com> <20220704143820.3071004-7-npiggin@gmail.com> From: Waiman Long In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/5/22 13:20, Peter Zijlstra wrote: > On Tue, Jul 05, 2022 at 12:38:13AM +1000, Nicholas Piggin wrote: >> There isn't much reason to keep these separate. > The reason was so that other paravirt implementations could be added. > > The CNA thing was also implemented this way... Do you have any plan to take CNA [1] some time in the future? Anyway, the main reason the paravirt code is separated into a separated file is to leave only the core part in qspinlock.c so that new users are overwhelmed with the messy details for the paravirt code. Putting everything into a single can make it harder to read for the newbies. Also eliminating the preprocessor trick will make it harder to integrate a different qspinlock variant, like CNA, into the code base. Cheers, Longman [1] https://lore.kernel.org/lkml/20210514200743.3026725-1-alex.kogan@oracle.com/