Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1194146imm; Tue, 3 Jul 2018 07:08:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeT8hRqMNATD6oexUbbYkm4GTCxb4gfhYcRcAsN/FgNjHaWF5lAUCx8uDq/j/H5WYDYMYec X-Received: by 2002:a62:8a83:: with SMTP id o3-v6mr30059287pfk.12.1530626886108; Tue, 03 Jul 2018 07:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530626886; cv=none; d=google.com; s=arc-20160816; b=CMhwxyYOXFTV1PhbVvy7RE4KpMqkgTPPR8WoH0RWppRcvl9fP3y3sRVph/uQ2Z28wT oikkw+z2rMZR3bUJk376pDpfqSboAT8CrPR8Dhbo98ikuoTOE2yKlJO4Q6mQjFAtOnlU /XJMJE7t6EYm/65NvwvXAeiul+g4VOmFN6PAUy7sq4/9PGfIB2MrcsqYYncOVw3FmdGE W8IqVS1RZIh5NpDkzrvOGT8T5glQixjocFT2HMez8leUa1V3t1gWlUDxPiZyEOKR1B9x ysVjkZFRHJ9ISCCV/hNPmVjQp/PFPewgB0wTW8MM83mlP4BYqOlR1Mgs34Ok66hjhuRM vpFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=96HcfpHJxs5s2pqZ8Jsm74a5Xsjfzu3goRLISpbi484=; b=ylTV2bv5N3GcxbZPA6Px7Jz67B3Dr83UooP5waDg4nKBFickLz1TlqKBQmVloEpbHI FismcHnQSTlDPdW0eYt5xrlOrqVov44E/2mJT8h2hsbJCsNlx5r9jWI8FUV12agLyK/J OAsfXYmdpqjokUBSYJx8CgLCzlPePFXi4pA9HlfSaUY5OXo8eKkkaNV4nT/uvFCdnxPs maLa+zOOu8R9xdDs1lPgrFvMSnErqRUJv4Wy7BmNzlS7+oxSTdf1NQUSfYEcGd07QDXC ZwiiplP6Ng+AnwPtOKT3R1OcWBTpNvjsvAYJGE78238F+Ri9LGBd2cSc2fQs+/PSokUA EF4Q== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15-v6si1090213pgv.62.2018.07.03.07.07.50; Tue, 03 Jul 2018 07:08:06 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbeGCOGc (ORCPT + 99 others); Tue, 3 Jul 2018 10:06:32 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44080 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932105AbeGCOG3 (ORCPT ); Tue, 3 Jul 2018 10:06:29 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w63E4LTv124705 for ; Tue, 3 Jul 2018 10:06:29 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k08s9wqe3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 03 Jul 2018 10:06:28 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jul 2018 15:06:27 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 3 Jul 2018 15:06:23 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w63E6Muq27721870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 3 Jul 2018 14:06:23 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73B894C044; Tue, 3 Jul 2018 17:06:48 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94D2D4C058; Tue, 3 Jul 2018 17:06:45 +0100 (BST) Received: from drishya.in.ibm.com (unknown [9.85.91.104]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 3 Jul 2018 17:06:45 +0100 (BST) Date: Tue, 3 Jul 2018 19:36:16 +0530 From: Vaidyanathan Srinivasan To: "Gautham R. Shenoy" Cc: akshay.adiga@linux.vnet.ibm.com, Nicholas Piggin , Michael Ellerman , "Rafael J. Wysocki" , Daniel Lezcano , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH] cpuidle:powernv: Add the CPUIDLE_FLAG_POLLING for snooze Reply-To: svaidy@linux.vnet.ibm.com References: <1530595456-32352-1-git-send-email-ego@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1530595456-32352-1-git-send-email-ego@linux.vnet.ibm.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-TM-AS-GCONF: 00 x-cbid: 18070314-0028-0000-0000-000002D7C1E5 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070314-0029-0000-0000-0000238F4365 Message-Id: <20180703140616.GA13660@drishya.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-03_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=861 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807030162 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Gautham R Shenoy [2018-07-03 10:54:16]: > From: "Gautham R. Shenoy" > > In the situations where snooze is the only cpuidle state due to > firmware not exposing any platform idle states, the idle CPUs will > remain in snooze for a long time with interrupts disabled causing the > Hard-lockup detector to complain. snooze_loop() will spin in SMT low priority with interrupt enabled. We have local_irq_enable() before we get into the snooze loop. Since this is a polling state, we should wakeup without an interrupt and hence we set TIF_POLLING_NRFLAG as well. > watchdog: CPU 51 detected hard LOCKUP on other CPUs 59 > watchdog: CPU 51 TB:535296107736, last SMP heartbeat TB:527472229239 (15281ms ago) > watchdog: CPU 59 Hard LOCKUP > watchdog: CPU 59 TB:535296252849, last heartbeat TB:526554725466 (17073ms ago) hmm.. not sure why watchdog will complain, maybe something more is going on. > Fix this by adding CPUIDLE_FLAG_POLLING flag to the state, so that the > cpuidle governor will do the right thing, such as not stopping the > tick if it is going to put the idle cpu to snooze. > > Reported-by: Akshay Adiga > Cc: Nicholas Piggin > Signed-off-by: Gautham R. Shenoy > --- > drivers/cpuidle/cpuidle-powernv.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/cpuidle/cpuidle-powernv.c b/drivers/cpuidle/cpuidle-powernv.c > index d29e4f0..b73041b 100644 > --- a/drivers/cpuidle/cpuidle-powernv.c > +++ b/drivers/cpuidle/cpuidle-powernv.c > @@ -156,6 +156,7 @@ static int stop_loop(struct cpuidle_device *dev, > { /* Snooze */ > .name = "snooze", > .desc = "snooze", > + .flags = CPUIDLE_FLAG_POLLING, > .exit_latency = 0, > .target_residency = 0, > .enter = snooze_loop }, Adding the CPUIDLE_FLAG_POLLING is good and enables more optimization. But the reason that we spin with interrupt disabled does not seem right. --Vaidy