From nobody Fri Nov 29 12:59:34 2024 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3969B179AE for ; Thu, 19 Sep 2024 13:16:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.147.86 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726751773; cv=none; b=WoR/9fAaZWcfbg+GGGsEDn7+BgyLIUQ5dVoD2Yg5trHV0pFMvK7tLglgIEPr/iyp92tZAcoSyuWcpMhUrbAY3fwikpbXhhyxKbIM67ONDRXAAEoDjT00ZFB0ieWL13/3qmmozYpFqtnZ0TJWbJOJqBaL2q3+ag+VGbU2j+zYMZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726751773; c=relaxed/simple; bh=FZCHOlzoPNDTM+K/dIu0m/V2QVNrmRgr1vPWK0Yi7hQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=mOWjBBnqSgAh4ev/28DsMS4ggjhe+QEmUxtqZCehdmnFDBNuVZDCLAvgKxZJGa/YwsqvQ8zk97lCLd9+UAdpzin0Oqfts0U5jaIULX03dK6u+Jw+a+yxEYAuTPGKNbctIWzAZGMRWG3n36H4c9h9M8RzwrSXnVJCkZh2ueDROjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com; spf=unknown smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=HI0g3EbW; arc=none smtp.client-ip=148.163.147.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=tempfail smtp.mailfrom=hpe.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="HI0g3EbW" Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48J732Ht020244; Thu, 19 Sep 2024 12:34:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=date :from:to:cc:subject:message-id:mime-version:content-type; s= pps0720; bh=r94TunqcIa3DXvjGd99z5cw77wZNtQZXebDwEsUnhIU=; b=HI0g 3EbWPNKWtoaKLgCTuTM4muQ2GDcGi65xAlGKHh+e+kuTrgd8+oWOeSQDfHZeZ4tk G8q/wI4X3BghlPNJBqdmnH9uDAls0dpDxxuCMHkxxav1lQzTqLuh9McaQTKG7883 ujkyb9i755Jw9h17QbAj40e090gKTwnot8WoZNDwQRf6cYDchzSSpNZ/lbWJIzBG RSEYh/bZTXiD2eE/mxpk0NJICFH7WmiiKR149ZQibbTWVzxG/+qFPWkxIsQMJ5uO VkNKJpRUiyRMtxg03uJnwwtvabq3nSI67CZKPNj8n7jB6FebrTezFVYu1bZqHQxJ vDgNDv4CZhiqkrfp5g== Received: from p1lg14878.it.hpe.com ([16.230.97.204]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 41r1457f4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Sep 2024 12:34:57 +0000 (GMT) Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14878.it.hpe.com (Postfix) with ESMTPS id CCC98D279; Thu, 19 Sep 2024 12:34:54 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.39]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTPS id 6DAFB801AFD; Thu, 19 Sep 2024 12:34:52 +0000 (UTC) Date: Thu, 19 Sep 2024 07:34:50 -0500 From: Dimitri Sivanich To: Linus Torvalds , Arnd Bergmann , Greg Kroah-Hartman , Dan Carpenter , Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dimitri Sivanich Subject: [PATCH] misc: sgi-gru: Don't disable preemption in GRU driver Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Proofpoint-GUID: -rgovnn5tEpUyXJgKCGNAAI8wvARF4Wg X-Proofpoint-ORIG-GUID: -rgovnn5tEpUyXJgKCGNAAI8wvARF4Wg X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-19_08,2024-09-19_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=727 phishscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 clxscore=1011 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 definitions=main-2409190081 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Disabling preemption in the GRU driver is unnecessary, and clashes with sleeping locks in several code paths. Remove preempt_disable and preempt_enable from the GRU driver. Signed-off-by: Dimitri Sivanich --- drivers/misc/sgi-gru/grukservices.c | 2 -- drivers/misc/sgi-gru/grumain.c | 4 ---- drivers/misc/sgi-gru/grutlbpurge.c | 2 -- 3 files changed, 8 deletions(-) diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/gru= kservices.c index 37e804bbb1f2..205945ce9e86 100644 --- a/drivers/misc/sgi-gru/grukservices.c +++ b/drivers/misc/sgi-gru/grukservices.c @@ -258,7 +258,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **= cb, void **dsr) int lcpu; =20 BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES); - preempt_disable(); bs =3D gru_lock_kernel_context(-1); lcpu =3D uv_blade_processor_id(); *cb =3D bs->kernel_cb + lcpu * GRU_HANDLE_STRIDE; @@ -272,7 +271,6 @@ static int gru_get_cpu_resources(int dsr_bytes, void **= cb, void **dsr) static void gru_free_cpu_resources(void *cb, void *dsr) { gru_unlock_kernel_context(uv_numa_blade_id()); - preempt_enable(); } =20 /* diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c index 0f5b09e290c8..3036c15f3689 100644 --- a/drivers/misc/sgi-gru/grumain.c +++ b/drivers/misc/sgi-gru/grumain.c @@ -937,10 +937,8 @@ vm_fault_t gru_fault(struct vm_fault *vmf) =20 again: mutex_lock(>s->ts_ctxlock); - preempt_disable(); =20 if (gru_check_context_placement(gts)) { - preempt_enable(); mutex_unlock(>s->ts_ctxlock); gru_unload_context(gts, 1); return VM_FAULT_NOPAGE; @@ -949,7 +947,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf) if (!gts->ts_gru) { STAT(load_user_context); if (!gru_assign_gru_context(gts)) { - preempt_enable(); mutex_unlock(>s->ts_ctxlock); set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(GRU_ASSIGN_DELAY); /* true hack ZZZ */ @@ -965,7 +962,6 @@ vm_fault_t gru_fault(struct vm_fault *vmf) vma->vm_page_prot); } =20 - preempt_enable(); mutex_unlock(>s->ts_ctxlock); =20 return VM_FAULT_NOPAGE; diff --git a/drivers/misc/sgi-gru/grutlbpurge.c b/drivers/misc/sgi-gru/grut= lbpurge.c index 10921cd2608d..1107dd3e2e9f 100644 --- a/drivers/misc/sgi-gru/grutlbpurge.c +++ b/drivers/misc/sgi-gru/grutlbpurge.c @@ -65,7 +65,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(= struct gru_state struct gru_tlb_global_handle *tgh; int n; =20 - preempt_disable(); if (uv_numa_blade_id() =3D=3D gru->gs_blade_id) n =3D get_on_blade_tgh(gru); else @@ -79,7 +78,6 @@ static struct gru_tlb_global_handle *get_lock_tgh_handle(= struct gru_state static void get_unlock_tgh_handle(struct gru_tlb_global_handle *tgh) { unlock_tgh_handle(tgh); - preempt_enable(); } =20 /* --=20 2.35.3