Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1142692lqo; Sat, 11 May 2024 09:05:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6H/Pj5FHpsPYT4yJySx0ptAhyr614sUlHRF1jedIV3PUR9SWk//IjmBeiT1ROWUDzZEwP1jTLtLncrZp8ZX1XnXPqZzUcR9cUCIzWvQ== X-Google-Smtp-Source: AGHT+IEd71ypq3U3s7/iA6riI/vNk3jtJ0ojM+DCB9mabxDWik990vRDZkIFToFD0VL1AJbgzQj7 X-Received: by 2002:a05:6870:5713:b0:244:c8a1:8086 with SMTP id 586e51a60fabf-244c8a1c7efmr220784fac.24.1715443527527; Sat, 11 May 2024 09:05:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715443527; cv=pass; d=google.com; s=arc-20160816; b=L1MK7T9eUGqV7e70dO+MDF290tJDWAhdS7XN+ZXGyjkjkpO1Ezuznh36flc0ZWdn9K hjBGh7kiG7kusDtLbyZoyi+Z1YRcn9L9ZbCb5AMuMip3JSd65AW+pg3K4FGM4qJ5vMe6 CQnIXZ8OAxi6xtvtKvb2ESTtZMIOqSYxzzVTDbZX5RCxR7zXljYwAJ2ukj7K6t5k+I0a cpNphaPVWa8hFvbjOViKHDOhm+UaxbltiDVbywl+A18R9GIl16+5+ul0JfqkuNIoStuY kEp/9yQYeKZpyKxWy2hex8H1KHXYbGpuHHd461w31O7uog/8ZSr8P5jG2ZudU+s8zURW 3jTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UP0RQCFejEFweF1A8DNne68f64ZB2q8cOhlPulA5RN4=; fh=mqohb5IAcQ7aYkY4+NqzY1cip+MzvRXT01Hq/wE5PO0=; b=X5HCy/HrXn6Z9rZcPq4rFu5oFqxVtdq3rjoNdth6wep5AQ99nfTcOOAHLw25TLLYn9 5Tj9ma/Ipy+wkfmcZjvyuUpQmYkMOrxmZH0Z3ytIu0u6jzK1koaKNJ/LGQvomVp1Xelb oW4b2m02/jCmoYy4oHxXZBg/alPiw2TJaqtO+PPI+LATAWuuSjopXkeoQt4R58MAMeRN W9zThOUkKNSIziNwokmUN2ALQM4l13D5ZXB7JRUgOKAwwvitWMWhR2fh7JjhQIGrYynt 5nW8O4PioS21LN0ki21toa6RpSMAhctaLs6ki0Db3BrdB6O2kP1IFY7cb+Jm7iIzbrqM ZJHw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mAPpiOoT; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-176635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176635-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4df39si6355239a12.703.2024.05.11.09.05.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 09:05:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mAPpiOoT; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-176635-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176635-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E37C728173E for ; Sat, 11 May 2024 16:05:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C078156B66; Sat, 11 May 2024 16:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="mAPpiOoT" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 4EA0C38DD3 for ; Sat, 11 May 2024 16:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715443521; cv=none; b=KTbsalhvsy4XnnmDBvq/SR82W5r2w17eYOwq4u0IvStr+wxjJBWPRROd10jm9D6wTIu9kW8XsZA0GaRztz2r1JMC0IhnH+L4n7BBi/gMsmek63qzhWxsK/d3gXOt+QL+NKVbq6fUMWhAtAok1AYmUsriZce9tDE9kpKt10XxoJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715443521; c=relaxed/simple; bh=fy69Df2LdSHue4EcW6UTO6judU9exNS5dZwz4R+6/N8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UN7V3geuJYRcV7MYA47a+hz7ZIToCNOAdpXjCLnacCyIx7sma7wTig/zxcStl5pwoxddqG7YaADZJK9QrZE7EoI+QAKggvltuqFrZ8OR7h/epk1nj6F1isUIarCvhjErYCG8ZPiszbNbMeKRJsQ3GHZnB6DB3sxFrqLbXGtNlag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=mAPpiOoT; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UP0RQCFejEFweF1A8DNne68f64ZB2q8cOhlPulA5RN4=; b=mAPpiOoTjjpni+zN7AOmjP1ID0 hZ7k4zVHEQiKs451Wv7kbbp7AKgp9dg3hHWuoaUkrb6Vdu4tB5sE2XMXdO5nPjo6T1sWiGqOLAH76 RP9GUC59c09FAIz8z5/5KuM+ySXT0YZUBG7C94I8xNIoyjqqlt/pjI2sX3QH5mdx1py8voMQitv+G kMPx7rLzN7grWGrr5DRm66uNZTmUDOl/iFoF1bWArS60GDBF2hlT0NBFg2y7Sp8Y/1ZGJvsckFgQ+ 6cHDbAoVQfbJZCD95Z5GJYe1qxeszJEmtfrgR01Nid3Wuh0F583xKVP/loZSL8rg+mhuoW8UKC2EB +DZEKMmQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s5pDm-00000005cvF-0DFn; Sat, 11 May 2024 16:05:14 +0000 Date: Sat, 11 May 2024 17:05:13 +0100 From: Matthew Wilcox To: xu.xin16@zte.com.cn Cc: akpm@linux-foundation.org, david@redhat.com, shy828301@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: =?iso-8859-1?Q?=A0=5BPATCH_linux-next?= =?iso-8859-1?Q?=5D_mm=2Fhuge=5Fmemory=3A_remove_redundant_locking_when_pa?= =?iso-8859-1?Q?rsing=A0THP?= sysfs input Message-ID: References: <20240511144048767fdB7EqYoMHEw6A5b6FrXM@zte.com.cn> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240511144048767fdB7EqYoMHEw6A5b6FrXM@zte.com.cn> On Sat, May 11, 2024 at 02:40:48PM +0800, xu.xin16@zte.com.cn wrote: > From: Ran Xiaokai > > Since sysfs_streq() only performs a simple memory comparison operation > and will not introduce any sleepable operation, So there is no > need to drop the lock when parsing input. Remove redundant lock > and unlock operations to make code cleaner. i disagree that it makes the code cleaner.