From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751871AbcFZGma (ORCPT ); Sun, 26 Jun 2016 02:42:30 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58741 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750940AbcFZGm3 (ORCPT ); Sun, 26 Jun 2016 02:42:29 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: xinhui.pan@linux.vnet.ibm.com From: Pan Xinhui To: linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, boqun.feng@gmail.com, Pan Xinhui Subject: [PATCH 0/2] implement vcpu preempted check Date: Sun, 26 Jun 2016 06:41:53 -0400 X-Mailer: git-send-email 2.4.11 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062606-8235-0000-0000-000008ABF510 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062606-8236-0000-0000-000032922995 Message-Id: <1466937715-6683-1-git-send-email-xinhui.pan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-06-26_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606260074 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is to fix some bad issues on an over-commited guest. test-caes: perf record -a perf bench sched messaging -g 400 -p && perf report 18.09% sched-messaging [kernel.vmlinux] [k] osq_lock 12.28% sched-messaging [kernel.vmlinux] [k] rwsem_spin_on_owner 5.27% sched-messaging [kernel.vmlinux] [k] mutex_unlock 3.89% sched-messaging [kernel.vmlinux] [k] wait_consider_task 3.64% sched-messaging [kernel.vmlinux] [k] _raw_write_lock_irq 3.41% sched-messaging [kernel.vmlinux] [k] mutex_spin_on_owner.is 2.49% sched-messaging [kernel.vmlinux] [k] system_call osq takes a long time with preemption disabled which is really bad. This is because vCPU A hold the osq lock and yield out, vCPU B wait per_cpu node->locked to be set. IOW, vCPU B wait vCPU A to run and unlock the osq lock. Even there is need_resched(), it did not help on such scenario. we may also need fix other XXX_spin_on_owner later based on this patch set. these spin_on_onwer variant cause rcu stall. Pan Xinhui (1): locking/osq: Drop the overload of osq_lock() pan xinhui (1): kernel/sched: introduce vcpu preempted interface include/linux/sched.h | 34 ++++++++++++++++++++++++++++++++++ kernel/locking/osq_lock.c | 18 +++++++++++++++--- 2 files changed, 49 insertions(+), 3 deletions(-) -- 2.4.11