From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17D38385501 for ; Mon, 9 Mar 2026 16:11:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072689; cv=none; b=Zdai2kjhTGcedeGkEhccm+jnHx/esziM5WY8eawblMeFI7dROmmzlwhGc4sFs4TUFLeCBMtOWx1vXgFtjjUF1nEnfOYhEHBMy2VK07kup8aP4vIncu1/hRF5jQ0YxML+4Yr986GgWcxlyq2Clu22BW7f68O5kOTwSxuN2dNPHo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773072689; c=relaxed/simple; bh=8myljXKa+bFkx/DlI80oMq+mPA1Dd1UPHTkVXCfmU5U=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=QL7GpKzr8/fCbzSEpwbraRVAmMa3I0L1ojVSgZCjgKAb7YZXdqW3vN835Ozq6WeiIoD8WWmh0eDL0/dTW8AIk8FIu5x1VFFRr6JA1qdZ25Zz2jsLjlpBF3pPwl2JzusJEpP2go3+aUt6vtCCTqRwIJNqIrBkkcSG3zrI1T6gk98= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=B6QqRV0s; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B6QqRV0s" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4852a8482fcso25675165e9.3 for ; Mon, 09 Mar 2026 09:11:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773072686; x=1773677486; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=8myljXKa+bFkx/DlI80oMq+mPA1Dd1UPHTkVXCfmU5U=; b=B6QqRV0sgymcHVN2uGVBZGmoPOgkkfq0psD0dr4ErjhVQZp7mAq6Hk8wPnZNxbh4/5 BTt9j8WOLlevQytqAwyrfaw+qMx0I91pcfVoPcx153+M0MkNEOQIhjWeG+voJiDAYVD+ KTRlxcpAPlPgsvXl0LojayFeJ/xhmSG8qN000AIPl2NMzeC0tAQIHQbzUCJCTFzODOgP n9Bv12a2KGUJlcspuXn4Ofr3Uy39ZRfZX5Ur3+8ABcmXZFgB4MlMfjVn7AiTihMkmGUF h26n0hM8E7257CenE0bB+22djVJ2rPoSsEXzJcp/h5AtSoUKVEX7jHTYP8Kn/nTCemZT bGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773072686; x=1773677486; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8myljXKa+bFkx/DlI80oMq+mPA1Dd1UPHTkVXCfmU5U=; b=jTgz7fbcv05PvdcWn2XWC+qOciyspurDa/1g+6pI18wVBmgGvq/ETHnOU3MxbP0Hm+ 6zDA4D4hdphSbnBVQhcAaotXklHwq1d2CkUObtsOqsvqL5mWzPgkhHzN0RGbtq8yA8fT U7WAJbICI0bh3mOE91yoXJGbhV2eCeYPbeFGoZK7IAXcZ+1TvUy3OAkhwHTgabBlMc34 DnuAGJZ0/R/2md01MXcfJyCnyF+wfmhvkMIam5KsZ+/A5GGA+4GNpmwWCTgQhAlrs20H ESFuPPUf5QNfhlA2LH4U0QNbdwT0/gMNcSffcUQI+HMVrlXUEQ34FYnukWl9C5Qj6iWy bW1A== X-Forwarded-Encrypted: i=1; AJvYcCVkMDsTBmZgYLnOgcOc0I6P8by7Pg6VMfFRlu3F3emFsnKrAJaYg0GVRjy3GBHkF5BjJyaj89Z3k+YnoXw=@vger.kernel.org X-Gm-Message-State: AOJu0YyaOV2KyP8mKCl9YmOwIeblKIkG1d9MEoPC04+rYjtDsyY0c9I5 D293V1zf9mL+icU8YJA0wlhSvx1NXKo2O8jie0Av0w8nOVOODAuh8c+B X-Gm-Gg: ATEYQzy8IXxuGAjdY3kD71W3j5mMQnTQO0sl0AVLF2qSpJl25tFTmSbpgaKGc6Lu1zs QsfupyxPdv7Khh4y7mYtFaioggzOcRZkvZN5deTPCI/agAn++t/ApqF6jiDUX5NJkPdRrBBO2QD UkA2Aw5Dj0aBQecaxv5+vfXTyX5Nqa9BrnUp3HCuDQxox3w0IwIL2uDRXwGmafTzhI+HY7dnmUv AxJ0FyS7L0pmnVdUd/ewCDX8PGNngZEF7Qnf+wBtPYsq9NnQ34o/GM5soBsyASx/VU3AE57/wwS 9K80a452ZfhS2pGTSDRZYTztesmI9zmKUf6g6MAj/Hi5+aDTmdKNdER1yIAPbQeYS+ftq7KJvdc qby5DWeSjtq6nVy73g8fzPSbxXVVe3xJtMeoSxHD9B28rD3yg3pO3LZLvj7kbeSEv2DyUiKwjXx wFbBHwLXzVj7NUKtdg92qmzcfNUnQ= X-Received: by 2002:a05:600c:3ba1:b0:485:41a6:cecf with SMTP id 5b1f17b1804b1-48541a6cf24mr1868905e9.15.1773072686250; Mon, 09 Mar 2026 09:11:26 -0700 (PDT) Received: from [127.0.0.1] ([86.1.69.5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48541b6f6e6sm2183745e9.10.2026.03.09.09.11.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Mar 2026 09:11:26 -0700 (PDT) Date: Mon, 9 Mar 2026 16:11:25 +0000 From: Josh Law To: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Josh Law Message-ID: <07e2ae8e-e6e9-4def-9eb2-2c48ce6669b8@gmail.com> In-Reply-To: <2026030914-task-stunned-21e0@gregkh> References: <20260301005836.2513391-1-objecting@objecting.org> <2026030914-task-stunned-21e0@gregkh> Subject: Re: [PATCH] staging: axis-fifo: minimize lock duration in write Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: <07e2ae8e-e6e9-4def-9eb2-2c48ce6669b8@gmail.com> 9 Mar 2026 16:07:50 Greg Kroah-Hartman : > On Sun, Mar 01, 2026 at 12:58:36AM +0000, Josh Law wrote: >> Memory allocation and copy from user space with vmemdup_user() is relati= vely slow and can sleep. Move it outside the lock to minimize the time the = mutex is held, reducing contention for concurrent accesses. > > Something happened with your line wrapping :( > > And are you sure that your change works?=C2=A0 What is wrong with grabbin= g > the lock this way? > > thanks, > > greg k-h The issue with grabbing the lock before vmemdup_user() is that the allocati= on and user-space copy can take a significant amount of time and can sleep. Also, it's just to be more efficient haha, and yes I'm sure this change wor= ks, I own the hardware, and it operates better... V/R Josh law