Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2801415imm; Mon, 10 Sep 2018 06:44:44 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb6mNplC0DtvtQXUeJZZTOMKLwBmvPK0PEtuwHXV64wcyyO0LA5sJNkhA8Yp8NqQtPqIXuV X-Received: by 2002:a17:902:25ab:: with SMTP id y40-v6mr21577167pla.120.1536587084526; Mon, 10 Sep 2018 06:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536587084; cv=none; d=google.com; s=arc-20160816; b=d/X6OtgwQ9rn8tb0JubRuIxAj7/K5xjkjf8FY9XYxJJUAaQiCM9Rrte6DIPjdabmFQ MzjEGnSc9cBpT6kyQNCgnNb29l7sRZKlaysQ8i4c/0XawPvympsk4PDkQzihpkmV3+l/ IMXK6KLLZssdVETuqTaIhdPsCBYv812UJdYstBoMDx57M26Vdnf9Z0D6/U0JAiMStBuY eW1Wun9lRCUIxIY9UsK3L/4I7C1ClwtLM5tn+KWLZmaUjAlCwmj449tyPtZ8oFwxfub1 wbd17Hlm+eCHjSR8HRHH/QIky+skC9tnu1WPwH3L6j5Rik0Gm3YK0WocmyzgS6fQK7EK IXuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :references:cc:to:subject:from; bh=cGKaHofatvczdmM5XWqdtUtTjygyenYSvc5G0L9GDj8=; b=p3Aqt5rra/Ngsbb3H11/F3vgYd7om4rPDJXI7Tjlpk4VvyhRIsjjwH489UbSKJZZXL WJViByVWaIMSJst95ZL/I+vLVwg7jXAf2jnarMQUYl6u1CSyiQSV6BNsCwGKmC7tiTQQ r8Tid6U9Sl2opXRKpr2gzlLi7iUbVPqrVGIsq5/qpcKuHni32A373MFaXKBTTLMw3jZS NuOnyYtLcU6UAKWbfbtZjkSnHzT6Bf6sqkqy+amrUMuLUAsBU5akQnzyYLKaET5o5jt2 yoA1TXqniY9TM4yx+ZIxImzZPiJ5eo4AKybyLqN4Xy7CF7+TSmrJ5GruufyQR05EHj35 cVdQ== 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 y18-v6si18060331pfb.161.2018.09.10.06.43.59; Mon, 10 Sep 2018 06:44:44 -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 S1728807AbeIJSco (ORCPT + 99 others); Mon, 10 Sep 2018 14:32:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43814 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727970AbeIJSco (ORCPT ); Mon, 10 Sep 2018 14:32:44 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8ADZSLQ003257 for ; Mon, 10 Sep 2018 09:38:35 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mdpvjr8hb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 10 Sep 2018 09:38:35 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Sep 2018 14:38:32 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 10 Sep 2018 14:38:30 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8ADcTtw51904716 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Sep 2018 13:38:29 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB5D2AE051; Mon, 10 Sep 2018 16:37:46 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D21BAE04D; Mon, 10 Sep 2018 16:37:46 +0100 (BST) Received: from [9.145.72.33] (unknown [9.145.72.33]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 Sep 2018 16:37:46 +0100 (BST) From: Laurent Dufour Subject: Re: [PATCH v2 0/3] powerpc/pseries: use H_BLOCK_REMOVE To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au Cc: aneesh.kumar@linux.ibm.com, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com References: <1534775376-22480-1-git-send-email-ldufour@linux.vnet.ibm.com> Date: Mon, 10 Sep 2018 15:38:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1534775376-22480-1-git-send-email-ldufour@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18091013-0008-0000-0000-0000026F2CA2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091013-0009-0000-0000-000021D75FF0 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-10_08:,, 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=728 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809100140 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, Do you plan to pull it for 4.20 ? Cheers, Laurent. On 20/08/2018 16:29, Laurent Dufour wrote: > On very large system we could see soft lockup fired when a process is > exiting > > watchdog: BUG: soft lockup - CPU#851 stuck for 21s! [forkoff:215523] > Modules linked in: pseries_rng rng_core xfs raid10 vmx_crypto btrfs libcrc32c xor zstd_decompress zstd_compress xxhash lzo_compress raid6_pq crc32c_vpmsum lpfc crc_t10dif crct10dif_generic crct10dif_common dm_multipath scsi_dh_rdac scsi_dh_alua autofs4 > CPU: 851 PID: 215523 Comm: forkoff Not tainted 4.17.0 #1 > NIP: c0000000000b995c LR: c0000000000b8f64 CTR: 000000000000aa18 > REGS: c00006b0645b7610 TRAP: 0901 Not tainted (4.17.0) > MSR: 800000010280b033 CR: 22042082 XER: 00000000 > CFAR: 00000000006cf8f0 SOFTE: 0 > GPR00: 0010000000000000 c00006b0645b7890 c000000000f99200 0000000000000000 > GPR04: 8e000001a5a4de58 400249cf1bfd5480 8e000001a5a4de50 400249cf1bfd5480 > GPR08: 8e000001a5a4de48 400249cf1bfd5480 8e000001a5a4de40 400249cf1bfd5480 > GPR12: ffffffffffffffff c00000001e690800 > NIP [c0000000000b995c] plpar_hcall9+0x44/0x7c > LR [c0000000000b8f64] pSeries_lpar_flush_hash_range+0x324/0x3d0 > Call Trace: > [c00006b0645b7890] [8e000001a5a4dd20] 0x8e000001a5a4dd20 (unreliable) > [c00006b0645b7a00] [c00000000006d5b0] flush_hash_range+0x60/0x110 > [c00006b0645b7a50] [c000000000072a2c] __flush_tlb_pending+0x4c/0xd0 > [c00006b0645b7a80] [c0000000002eaf44] unmap_page_range+0x984/0xbd0 > [c00006b0645b7bc0] [c0000000002eb594] unmap_vmas+0x84/0x100 > [c00006b0645b7c10] [c0000000002f8afc] exit_mmap+0xac/0x1f0 > [c00006b0645b7cd0] [c0000000000f2638] mmput+0x98/0x1b0 > [c00006b0645b7d00] [c0000000000fc9d0] do_exit+0x330/0xc00 > [c00006b0645b7dc0] [c0000000000fd384] do_group_exit+0x64/0x100 > [c00006b0645b7e00] [c0000000000fd44c] sys_exit_group+0x2c/0x30 > [c00006b0645b7e30] [c00000000000b960] system_call+0x58/0x6c > Instruction dump: > 60000000 f8810028 7ca42b78 7cc53378 7ce63b78 7d074378 7d284b78 7d495378 > e9410060 e9610068 e9810070 44000022 <7d806378> e9810028 f88c0000 f8ac0008 > > This happens when removing the PTE by calling the hypervisor using the > H_BULK_REMOVE call. This call is processing up to 4 PTEs but is doing a > tlbie for each PTE it is processing. This could lead to long time spent in > the hypervisor (sometimes up to 4s) and soft lockup being raised because > the scheduler is not called in zap_pte_range(). > > Since the Power7's time, the hypervisor is providing a new hcall > H_BLOCK_REMOVE allowing processing up to 8 PTEs with one call to > tlbie. By limiting the amount of tlbie generated, this reduces the time > spent invalidating the PTEs. > > This hcall requires that the pages are "all within the same naturally > aligned 8 page virtual address block". > > With this patch series applied, I couldn't see any soft lockup raised on > the victim LPAR I was running the test one. > > Changes since V1: > - Remove a call to BUG_ON() in call_block_remove() since this one can be > handled gently. > - Remove uneeded of current_vpgb to 0 when retrying entries in > hugepage_block_invalidate() and do_block_remove(). > > Laurent Dufour (3): > powerpc/pseries/mm: Introducing FW_FEATURE_BLOCK_REMOVE > powerpc/pseries/mm: factorize PTE slot computation > powerpc/pseries/mm: call H_BLOCK_REMOVE > > arch/powerpc/include/asm/firmware.h | 3 +- > arch/powerpc/include/asm/hvcall.h | 1 + > arch/powerpc/platforms/pseries/firmware.c | 1 + > arch/powerpc/platforms/pseries/lpar.c | 241 ++++++++++++++++++++++++++++-- > 4 files changed, 230 insertions(+), 16 deletions(-) >