Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2654697ybh; Fri, 24 Jul 2020 20:03:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwG8IDYtMYe7uDQmmpIMbfSIPgTa3FWDzcM88HcObmJIkf2wvb+DTWTIxzdum+z5HxRP/+w X-Received: by 2002:a05:6402:3113:: with SMTP id dc19mr11564192edb.20.1595646233031; Fri, 24 Jul 2020 20:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595646233; cv=none; d=google.com; s=arc-20160816; b=DPOJD2g7JZFTEPvuK1ZiCjGlWdMbxaTDSDujMLnFWv86XmI9wi8bCtV9Yl4tJa9g03 MGGcFCxrQv1h4xElWE481bRSZfNIZKaNV7JP7iYzCJeuaf05BVAdb6SjDhE6SBnyVRCw lm+tjgscWDH/ma3RuoHLihKIc/Xu6dFGZ2gIarIVDsSLRkrfAuv81QijdBoBv1GIPZ/5 wZkMuoMc1btYUwt/Haw7zCnnNmXJKE26hA24ohyjisfZNeB6kMoGm9VerukaTbOqIyMf 9K5t6wE0gRz2Yy++rD7ZwZTAjMTaLoMJ41+6CbPfgrIVcpPz2CJD6B0caPkG/Ghw6eF+ 2kpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:references:cc:to:from:subject :dkim-signature; bh=dJKlmgtXl7uNqK+gi01GLPol8dXOhIFF+vRj8dKFHJ4=; b=XgRqfnr2AV+19SMyeK9vO8jB8i/DZFDBe9pU1+rI08DclN7L7Dfl0RNy8YF6AFUpPA 6avj2095WWGMH+zoVntO7nKYHPRFZpyaydptcjl3NxMu9l8RTKT62JeR6jO5xNm/wZnN vqp6BWpPW5KTjJSk0s5qaL2mOv8f3IYkFt+v9egWWhf4ArjnA8dlgO62vtWzEK65hYZn ST5VvP0iINQ4GuCzK6AljsgWMEzUY5i6fhHqtMGPygUUbEvInXGiqvFXhPwiRhiqFgoi uU17tVtIr9E7v7IeYJeW2rPfcuQpXCWzcMuHX8sCk7ZJnpA7kAWE2JxDVCd/sGXK5F7p Nd4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Anfbl2kc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si1613292edy.409.2020.07.24.20.03.29; Fri, 24 Jul 2020 20:03:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Anfbl2kc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbgGYDDI (ORCPT + 99 others); Fri, 24 Jul 2020 23:03:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55504 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726572AbgGYDDH (ORCPT ); Fri, 24 Jul 2020 23:03:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595646186; 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=dJKlmgtXl7uNqK+gi01GLPol8dXOhIFF+vRj8dKFHJ4=; b=Anfbl2kcsBmd0PI36qol9zAkRgk0jUE4SYT3TPGKkKjzvAS3che2+YFxVTPSqRXDyfgpzm LmpNe/cBem1mtkTk9js6lFbJ4UVjgW3QeWTr2joXPbTaN1ezEPrLtj+xi4sTGzyCy+lZ2W jk5KGjDzM1hkF1Z/u+KA3PY92MHdlsI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-taJbuqtoOr-9IUyajzXA8A-1; Fri, 24 Jul 2020 23:03:02 -0400 X-MC-Unique: taJbuqtoOr-9IUyajzXA8A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AA6B958; Sat, 25 Jul 2020 03:03:00 +0000 (UTC) Received: from llong.remote.csb (ovpn-117-203.rdu2.redhat.com [10.10.117.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id B17D18FA2A; Sat, 25 Jul 2020 03:02:58 +0000 (UTC) Subject: Re: [PATCH v3 5/6] powerpc/pseries: implement paravirt qspinlocks for SPLPAR From: Waiman Long To: Will Deacon , peterz@infradead.org Cc: Michael Ellerman , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, Boqun Feng , Ingo Molnar , Anton Blanchard , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org References: <20200706043540.1563616-1-npiggin@gmail.com> <20200706043540.1563616-6-npiggin@gmail.com> <874kqhvu1v.fsf@mpe.ellerman.id.au> <8265d782-4e50-a9b2-a908-0cb588ffa09c@redhat.com> <20200723140011.GR5523@worktop.programming.kicks-ass.net> <845de183-56f5-2958-3159-faa131d46401@redhat.com> <20200723184759.GS119549@hirez.programming.kicks-ass.net> <20200724081647.GA16642@willie-the-truck> <8532332b-85dd-661b-cf72-81a8ceb70747@redhat.com> Organization: Red Hat Message-ID: Date: Fri, 24 Jul 2020 23:02:58 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <8532332b-85dd-661b-cf72-81a8ceb70747@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/20 3:10 PM, Waiman Long wrote: > On 7/24/20 4:16 AM, Will Deacon wrote: >> On Thu, Jul 23, 2020 at 08:47:59PM +0200, peterz@infradead.org wrote: >>> On Thu, Jul 23, 2020 at 02:32:36PM -0400, Waiman Long wrote: >>>> BTW, do you have any comment on my v2 lock holder cpu info >>>> qspinlock patch? >>>> I will have to update the patch to fix the reported 0-day test >>>> problem, but >>>> I want to collect other feedback before sending out v3. >>> I want to say I hate it all, it adds instructions to a path we spend an >>> aweful lot of time optimizing without really getting anything back for >>> it. >>> >>> Will, how do you feel about it? >> I can see it potentially being useful for debugging, but I hate the >> limitation to 256 CPUs. Even arm64 is hitting that now. > > After thinking more about that, I think we can use all the remaining > bits in the 16-bit locked_pending. Reserving 1 bit for locked and 1 > bit for pending, there are 14 bits left. So as long as NR_CPUS < 16k > (requirement for 16-bit locked_pending), we can put all possible cpu > numbers into the lock. We can also just use smp_processor_id() without > additional percpu data. Sorry, that doesn't work. The extra bits in the pending byte won't get cleared on unlock. That will have noticeable performance impact. Clearing the pending byte on unlock will cause other performance problem. So I guess we will have to limit the cpu number in the locked byte. Regards, Longman