From patchwork Thu Sep 19 12:34:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri Sivanich X-Patchwork-Id: 13807688 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52AFDCE8D7D for ; Thu, 19 Sep 2024 12:35:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF1E56B008A; Thu, 19 Sep 2024 08:35:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA0976B008C; Thu, 19 Sep 2024 08:35:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8FFA6B0092; Thu, 19 Sep 2024 08:35:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9AE3A6B008A for ; Thu, 19 Sep 2024 08:35:14 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 01BD81C4A82 for ; Thu, 19 Sep 2024 12:35:13 +0000 (UTC) X-FDA: 82581432948.07.8C58658 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by imf22.hostedemail.com (Postfix) with ESMTP id 25991C0011 for ; Thu, 19 Sep 2024 12:35:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=hpe.com header.s=pps0720 header.b="HI0g 3Eb"; dmarc=temperror reason="query timed out" header.from=hpe.com (policy=temperror); spf=temperror (imf22.hostedemail.com: error in processing during lookup of sivanich@hpe.com: DNS error) smtp.mailfrom=sivanich@hpe.com 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: 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 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 25991C0011 X-Stat-Signature: si7z4uxn13y7pnq8o35ba5fjx1ixxpu6 X-Rspam-User: X-HE-Tag: 1726749303-568174 X-HE-Meta: U2FsdGVkX191OEWUQvUY6mngZ/WSw+K0eGvfRLHU9KsT2NFLdTlas+DkCrkSHF+n4+5vmDfPgnl9tCxuVgOWW/905xk/H0PaNfhdU54BkczRaPhtGwjmu3mtKhQIUd6bh6S+Y7IoCBe4lcdPkyaVOxw06EkS2HTAoVM4+dAUZQxo2HZ+0ZIdf2zc4LUJB6kIWiM+yAEiG/NurcgezDH+SrYcZFzwDUqT4TM+VNFx7r7tF0nhk/neG/ynH9CknTLowYU8RgUEuCL0llRr5bpG2f7bk48bh4Nfgy8pCWaG+BiEe/RrVWuKlD5zSdYjG2qADpSz2nDGSdXWg0fW1z074XSWEfi/yjWN1SoL+xhJIQqRYEkIZCI3s2CiwzdRqAQwmBmJgmCRIzlgrmeFdbjNPjPU0LLbZWt0iWR9+zeZsrcXqIoqLjOxyXDZT61iug7mYwYaSY1De2346GxdaP78JKtpkLqTwIiUdpnG7uXidBVbbDyy0qimvGNWYArHQU/nKUwEfjnAyR3Fe6jhWmzrQ/8S2lhmBYY8o5r6RW3Zu75xxjsUeZAt7KHW/Li4zYuS3ldUwHJKM41+dQRbPTujTkWIQTYbHiattnPogsPCWP5GKzqn5k7lTWya4gUvSJevAZ++PXcTJZ4BB0DjbmjgKo7A1nRpi5+Pd8VN4Fl28uYYj8P6BaFrBbowJzxB5k9+wUtzZxvCgPOpY1C/jUv9KajwgdSKeF2WDJNRTRQBgU6MRp40vmzIsy1LpVMEBXRiyvkrk6nH6mN7oZ6/Od3FznsjNnprjZ6OfRYLjBDt4JIYY5RNAgOIW0baKc6Iu2afNBSp6/aGEIw+qNs0n8ZptEGzaTzUD4LDalsqKVbe50l1qqO/EvvHdWCjKj0H8DPP5YK6ppKfAgHLfrefUEC3zRj4+k0C5hYy5TWxBXRaBfyVjReURNulN+pXFe+7fKYLsBmfrgcWED9WVlcB2Sw oq/AK5Co hA4/Ofn/4H3RS9XxwLjwOi9YU2PPhV0HKKkXv0v7RNJ3FnRdyt3u+eixgtFLlsIDEnI6Jyh6yMMVKI+HQ+nAF8+4YcUkwy9+GOZgNanaw+O6yjR80ghyagwf9gMSz2PcFFS6nh+QDkR+j10YimJg2AdtbyoiZeFvYMbntx341ZEhZv0OVor1GzF9BkUItDzsMZI0L X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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/grukservices.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; BUG_ON(dsr_bytes > GRU_NUM_KERNEL_DSR_BYTES); - preempt_disable(); bs = gru_lock_kernel_context(-1); lcpu = uv_blade_processor_id(); *cb = 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(); } /* 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) again: mutex_lock(>s->ts_ctxlock); - preempt_disable(); 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); } - preempt_enable(); mutex_unlock(>s->ts_ctxlock); return VM_FAULT_NOPAGE; diff --git a/drivers/misc/sgi-gru/grutlbpurge.c b/drivers/misc/sgi-gru/grutlbpurge.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; - preempt_disable(); if (uv_numa_blade_id() == gru->gs_blade_id) n = 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(); } /*