From patchwork Tue Nov 6 12:40:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 993680 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42q8kJ30Wnz9s8T for ; Tue, 6 Nov 2018 23:58:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=debian.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42q8kJ1L62zF15C for ; Tue, 6 Nov 2018 23:58:48 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=debian.org X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=debian.org (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=leitao@debian.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=debian.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42q8KR6Nk9zF39Q for ; Tue, 6 Nov 2018 23:40:43 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wA6CYVkl132367 for ; Tue, 6 Nov 2018 07:40:40 -0500 Received: from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nk9v13avd-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 06 Nov 2018 07:40:40 -0500 Received: from localhost by e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 6 Nov 2018 12:40:40 -0000 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 6 Nov 2018 12:40:37 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wA6Ceadj3932564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Nov 2018 12:40:36 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97344AC05E; Tue, 6 Nov 2018 12:40:36 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 552E6AC059; Tue, 6 Nov 2018 12:40:35 +0000 (GMT) Received: from debra.ibm.com (unknown [9.18.239.97]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 6 Nov 2018 12:40:35 +0000 (GMT) From: Breno Leitao To: linuxppc-dev@lists.ozlabs.org Subject: [RFC PATCH 04/14] powerpc/tm: Always set TIF_RESTORE_TM on reclaim Date: Tue, 6 Nov 2018 10:40:18 -0200 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1541508028-31865-1-git-send-email-leitao@debian.org> References: <1541508028-31865-1-git-send-email-leitao@debian.org> X-TM-AS-GCONF: 00 x-cbid: 18110612-2213-0000-0000-000003121E06 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009996; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01113483; UDB=6.00577209; IPR=6.00893582; MB=3.00024045; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-06 12:40:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18110612-2214-0000-0000-00005C289539 Message-Id: <1541508028-31865-5-git-send-email-leitao@debian.org> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-06_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=887 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811060112 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org, gromero@linux.vnet.ibm.com, Breno Leitao , ldufour@linux.vnet.ibm.com, cyrilbur@gmail.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" If the task data was reclaimed (through TM_KERNEL_ENTRY), then it needs to be recheckpointed later, once exiting to userspace. The recheckpoint is done by restore_tm_state() function, which is called on our way to userspace if the task has the TIF_RESTORE_TM flag set. This patch makes sure the task has TIF_RESTORE_TM tag set every time there is a reclaim, so, a recheckpoint will be executed later. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index c7e758a42b8f..1842fd96b123 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -883,6 +883,9 @@ static void tm_reclaim_thread(struct thread_struct *thr, uint8_t cause) tm_reclaim(thr, cause); + /* Tag it so restore_tm_state will pay attention to this task */ + set_thread_flag(TIF_RESTORE_TM); + /* * If we are in a transaction and FP is off then we can't have * used FP inside that transaction. Hence the checkpointed