From patchwork Tue Jul 17 00:55:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 10527833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D633600F4 for ; Tue, 17 Jul 2018 00:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13130285A5 for ; Tue, 17 Jul 2018 00:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 066F728BDD; Tue, 17 Jul 2018 00:55:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B70C285A5 for ; Tue, 17 Jul 2018 00:55:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2196A6B0266; Mon, 16 Jul 2018 20:55:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 178AB6B026A; Mon, 16 Jul 2018 20:55:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01BE76B026B; Mon, 16 Jul 2018 20:55:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by kanga.kvack.org (Postfix) with ESMTP id A6FB46B0266 for ; Mon, 16 Jul 2018 20:55:50 -0400 (EDT) Received: by mail-pg1-f198.google.com with SMTP id t5-v6so4162698pgt.18 for ; Mon, 16 Jul 2018 17:55:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=5eddp19in6WIWp1djMRTja3hzr4XC0OOocVAgX/bGIY=; b=XKoSPbQ1kLJxDOtoNn0n7Z64GETtwfsSuPEU8IqTgFjC2DcoeeK6mTIRJo8VPAhxhm +7Br/70D9wjnFkxk46mks7r9j1s+5T18LjABo7F23sqUOlsA9lBAGBBoNJxC+Oe8j93q kYM8I0VwD68y40a39tZxtvK76zC2P49xq3/nHPsVKOcoUNLArR9S/QR/ZYRtvbW103P/ Og856dFV5kgXBC2MDWuNaCtpETUCLa2OW4ZrwR1OY7exC3IGTpzj+gQ9fLXGox/G+mvM QTcU+5eQCr7nzhUJ+7DV3+cJ56XM9TezhNE/onmHsexBcDM5GbHS+XkoCpUgxzrk83xW p7Nw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ying.huang@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AOUpUlHl2yyEYtbbFxOEwd/vnZY+ETKf+Ok0acsTCALxhTuIfTOPYG9u ynEaMq1mX5kuyxkXzapQkfL2XdMQI9HPrMSc/DeJQlSaS30hJ1XSCKeYaDC3vIHR4msyzF6S+WO wtT1tmYe7noSM6sw3/a8HzyfR882gRHoyFJ7AszY6nY/bA/QweWRrXCcW2b2Q7u0Y5A== X-Received: by 2002:a63:7e1a:: with SMTP id z26-v6mr17365557pgc.278.1531788950376; Mon, 16 Jul 2018 17:55:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe2IyepE19jGmFhIiJBdIXLAu8pIFfWWM6u6yws7+bH51Yc8GzgNO1AY14G38jMyb1ppVij X-Received: by 2002:a63:7e1a:: with SMTP id z26-v6mr17365532pgc.278.1531788949546; Mon, 16 Jul 2018 17:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531788949; cv=none; d=google.com; s=arc-20160816; b=npvT+RcVAXMMQ0ulXbCXq1rCClltduBaeDAHqFdMXZeGH3SuJSAQRXHdTZWhIoS7Wj mYSIoehC6oy0kfSbhQ5NCn1wRI0ZbOg+DT1XvK1s6sX6T+tn3TkphoDyMi6WUUGmWvUe d5mFbVyQrL7CAj4XcQATG1c9Detufx1zm9TpmvmNfd6K8hOQRFRcAvZlVjSQCC4zMFDP d1/BzphjR7b97xS6Oqns0s83yVV4l4EzyXz9cd9urGBSEyeOdqKQJjbUefSawAgleJG0 qk8AL6NnB5nj7Ox8kibJ2syQqUiT3OGDflc97WaMJczMo1tp/Ro7IBTxYNy51ekomPc8 j3xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=5eddp19in6WIWp1djMRTja3hzr4XC0OOocVAgX/bGIY=; b=cBoh3tUHfL2Jpp0Fk8olU4SEIBd2BjMpKpmsLh16Seigs7Gbq3yEX4dKRetcyJsUJp g5KccQuF8xObkipJLeRmdNnl1HwtG6fpKGIe3+DSREuiOE1F9xF1/hmy3EqMRWRul1GM 5hg4oGe4opqb/hIVQ/NIek5sC1m/tFidOSpYnWkB6UAy5vKBk3/EaVai19+hUFdzY414 xFj3Mh2vZaS5flIfanXMDRYWXU2MG576hVvD50N/wv6wnsUV9bi+h71NmlKOPhPHfqxY 8yNxOf+HygXo56IaEJ/buj9ozDmKo6uztaGS3+TM0ZPQONvIYSp8PKGwpufsQ+y90wW2 pgtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ying.huang@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga18.intel.com (mga18.intel.com. [134.134.136.126]) by mx.google.com with ESMTPS id bc5-v6si30619643plb.413.2018.07.16.17.55.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Jul 2018 17:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ying.huang@intel.com designates 134.134.136.126 as permitted sender) client-ip=134.134.136.126; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ying.huang@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jul 2018 17:55:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,363,1526367600"; d="scan'208";a="245788277" Received: from yhuang6-ux31a.sh.intel.com ([10.239.197.184]) by fmsmga005.fm.intel.com with ESMTP; 16 Jul 2018 17:55:47 -0700 From: "Huang, Ying" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Johannes Weiner , Shaohua Li , Hugh Dickins , Minchan Kim , Rik van Riel , Daniel Jordan , Dan Williams , Dave Hansen Subject: [PATCH v2 1/7] swap: Add comments to lock_cluster_or_swap_info() Date: Tue, 17 Jul 2018 08:55:50 +0800 Message-Id: <20180717005556.29758-2-ying.huang@intel.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180717005556.29758-1-ying.huang@intel.com> References: <20180717005556.29758-1-ying.huang@intel.com> 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: X-Virus-Scanned: ClamAV using ClamSMTP To improve the code readability. Signed-off-by: "Huang, Ying" Suggested-by: Dave Hansen Cc: Michal Hocko Cc: Johannes Weiner Cc: Shaohua Li Cc: Hugh Dickins Cc: Minchan Kim Cc: Rik van Riel Cc: Daniel Jordan Cc: Dan Williams --- mm/swapfile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/swapfile.c b/mm/swapfile.c index d8fddfb000ec..0a2a9643dd78 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -297,6 +297,12 @@ static inline void unlock_cluster(struct swap_cluster_info *ci) spin_unlock(&ci->lock); } +/* + * For non-HDD swap devices, the fine grained cluster lock is used to + * protect si->swap_map. But cluster and cluster locks isn't + * available for HDD, so coarse grained si->lock will be used instead + * for that. + */ static inline struct swap_cluster_info *lock_cluster_or_swap_info( struct swap_info_struct *si, unsigned long offset)