Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp365866imu; Fri, 11 Jan 2019 01:41:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN6YWWjJZmyG9NDTWvEV4u9OIhaIRDyRS912lkBlvz2aoNAgK1EegVWwHnHpS12b+knN+eEs X-Received: by 2002:a63:b34f:: with SMTP id x15mr12848252pgt.243.1547199667311; Fri, 11 Jan 2019 01:41:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547199667; cv=none; d=google.com; s=arc-20160816; b=kR0IJ+5yhHd+qaDJP9FlEfPRAnKzZG8dckC/r8Dg5cIGJZ1552oSsRC1AfRwppp4YQ Wy/43hJ11C0JLICeaTN+39YT8w8ocWDeNq2LwIb3hSwLeuZ2L+AmKniwqWgi8SL1PoIf 3hmsCR5hc9T72aMs0UT5vrljE5+D1CVzGZKzhyDBBKHz2KFPVZTZpeEzU7XwIaNPtA+I hkbiwGrXRtEatlf4DV05UKIPQeMy4NIjqDMNIRuqkFqlGVL+mdP34nf39nyT01cFqaly INoi06kZ0tPiLjP90u+dB0dPlX4RrVtJLkeNYSzNjaE/rAP9IKZOqA6xFOjHjHrU5sne 94ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2nGGM5Q3jk/aDnLCKMTW6iVRh37jiPxYSKQ4Jhzs7sM=; b=Gsg0I1DnFmqSvZ3PuNrQu5hpkjf4q4g3MewAdP6MPILR5xFVyceY90XNrG+tmXIEgZ XrSVrR50upUgFpZZb+33/3Wy4Ux53w161L9ddrQp/cnHB1rfFxpvPXjcqKz0clfBs7Eg sA1iotRdc543g1etp4B1hxKuExpWDVe/hFj30ZXDhesIRLMxpkwPKvSlKzRqfe4WKrwp lUodO2IhfiN+M+Xj17xCNM/Sv+Juf19/R5zXJZS8B/klnBdUeAortsTH4G4fBfQWUwdy n+97IU8z+cBFdMFKkeMU4cyL2rT++kEVpJ8iFfCi+WYdvV9NoI2eUhyIvqpQK5UkUPYp sAVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EDXjX+mn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si68637788pgs.94.2019.01.11.01.40.48; Fri, 11 Jan 2019 01:41:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=EDXjX+mn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731383AbfAKJQt (ORCPT + 99 others); Fri, 11 Jan 2019 04:16:49 -0500 Received: from merlin.infradead.org ([205.233.59.134]:55884 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbfAKJQt (ORCPT ); Fri, 11 Jan 2019 04:16:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2nGGM5Q3jk/aDnLCKMTW6iVRh37jiPxYSKQ4Jhzs7sM=; b=EDXjX+mnvbpLSLucLkWyfIaJu0 iH8nnXDHFYerqA7mPRzV0AYiMuiH89YY7a9UxRQvsIZkJZM60Dkj9ZxMbtoN/aAsKtKYyrSOWi8HR DOYyq3SlCv/EOwhP4Z9EEiy0bxLA7wvVta42lrGZzZh5dq/pP3c/EwhX1CF4CrNwhftwKwKnqH4M6 p5YEIhVVqWJw3sJjUg4fRq0EzfRwx7Hqx9DufeLRZmFMkpfQ7W1rCNoB1yIv2HOD0dNgWsN6fA8di JckPlDcLkMYFFVOSyzXZTbFBlNYjr2nedvvgHg093QTknzDg5DlR0hHAzBAQeEK4be2X/glHA/wRf xKpHydzg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ghsvf-0007xH-SU; Fri, 11 Jan 2019 09:16:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4F0B420280450; Fri, 11 Jan 2019 10:16:38 +0100 (CET) Date: Fri, 11 Jan 2019 10:16:38 +0100 From: Peter Zijlstra To: Zhenzhong Duan Cc: Waiman Long , LKML , SRINIVAS , Borislav Petkov Subject: Re: Question about qspinlock nest Message-ID: <20190111091638.GK30894@hirez.programming.kicks-ass.net> References: <910e9fb6-d0df-4711-fe2b-244b3c20eb82@redhat.com> <2eca6f60-3e8b-a389-27cb-8adbd9676607@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2eca6f60-3e8b-a389-27cb-8adbd9676607@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 04:06:52PM +0800, Zhenzhong Duan wrote: > > On 2019/1/10 22:43, Waiman Long wrote: > > On 01/10/2019 03:02 AM, Zhenzhong Duan wrote: > > > Hi Maintainer, > > > > > > > > > There is a question confused me for days. Appreciate an answer. > > > > > > In below code, the comment says we never have more than 4 nested > > > contexts. > > > > > > What happen if debug and mce exceptions nest with the four, or we > > > ensure it never happen? > > > > > > > > > /* > > > ?* Per-CPU queue node structures; we can never have more than 4 nested > > > ?* contexts: task, softirq, hardirq, nmi. > > > ?* > > > ?* Exactly fits one 64-byte cacheline on a 64-bit architecture. > > > ?* > > > ?* PV doubles the storage and uses the second cacheline for PV state. > > > ?*/ > > > static DEFINE_PER_CPU_ALIGNED(struct qnode, qnodes[MAX_NODES]); > > > > > Yes, both debug and mce exceptions are some kind of NMIs. So > > theoretically, it is possible to have more than four. Are you aware of > > any debug and MCE exception handlers that need to take a spinlock for > > synchronization? > > Not for debug exception, for MCE exception handler I found below two: > > do_machine_check->mce_report_event->schedule_work > do_machine_check->force_sig->force_sig_info > > schedule_work() and force_sig_info() take spinlocks. Boris, how can this be?