From patchwork Sun Mar 19 16:41:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 740709 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vmQ3W0krcz9s7K for ; Mon, 20 Mar 2017 03:47:19 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vmQ3V67Y3zDqdR for ; Mon, 20 Mar 2017 03:47:18 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3vmPyG29yGzDqZR for ; Mon, 20 Mar 2017 03:42:46 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2JGcYM8084589 for ; Sun, 19 Mar 2017 12:42:28 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 298y7cymfx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 19 Mar 2017 12:42:27 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 19 Mar 2017 12:42:26 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 19 Mar 2017 12:42:24 -0400 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2JGgODb44302380; Sun, 19 Mar 2017 16:42:24 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A1C1E11204B; Sun, 19 Mar 2017 12:42:22 -0400 (EDT) Received: from skywalker.in.ibm.com (unknown [9.85.69.200]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP id CC288112034; Sun, 19 Mar 2017 12:42:20 -0400 (EDT) From: "Aneesh Kumar K.V" To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Subject: [RFC PATCH 2/3] mm: Let arch choose the initial value of task size Date: Sun, 19 Mar 2017 22:11:57 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489941718-10734-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1489941718-10734-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17031916-0024-0000-0000-0000021DB7F1 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006811; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000206; SDB=6.00835947; UDB=6.00410796; IPR=6.00613714; BA=6.00005218; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014715; XFM=3.00000013; UTC=2017-03-19 16:42:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031916-0025-0000-0000-000042AE78AD Message-Id: <1489941718-10734-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-19_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703190153 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, "Aneesh Kumar K.V" Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" As we start supporting larger address space (>128TB), we want to give architecture a control on max task size of an application which is different from the TASK_SIZE. For ex: ppc64 needs to track the base page size of a segment and it is copied from mm_context_t to PACA on each context switch. If we know that application has not used an address range above 128TB we only need to copy details about 128TB range to PACA. This will help in improving context switch performance by avoiding larger copy operation. Signed-off-by: Aneesh Kumar K.V --- fs/exec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/exec.c b/fs/exec.c index 65145a3df065..5550a56d03c3 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1308,6 +1308,14 @@ void would_dump(struct linux_binprm *bprm, struct file *file) } EXPORT_SYMBOL(would_dump); +#ifndef arch_init_task_size +static inline void arch_init_task_size(void) +{ + current->mm->task_size = TASK_SIZE; +} +#define arch_init_task_size arch_init_task_size +#endif + void setup_new_exec(struct linux_binprm * bprm) { arch_pick_mmap_layout(current->mm); @@ -1327,7 +1335,7 @@ void setup_new_exec(struct linux_binprm * bprm) * depend on TIF_32BIT which is only updated in flush_thread() on * some architectures like powerpc */ - current->mm->task_size = TASK_SIZE; + arch_init_task_size(); /* install the new credentials */ if (!uid_eq(bprm->cred->uid, current_euid()) ||