Message ID | 20230627120833.2230766-3-mawupeng1@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 14E89C0015E for <linux-mm@archiver.kernel.org>; Tue, 27 Jun 2023 12:08:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E79BA8D0006; Tue, 27 Jun 2023 08:08:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E245E8D0001; Tue, 27 Jun 2023 08:08:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B648F8D0006; Tue, 27 Jun 2023 08:08:48 -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 A9D9E8D0001 for <linux-mm@kvack.org>; Tue, 27 Jun 2023 08:08:48 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 778251C8924 for <linux-mm@kvack.org>; Tue, 27 Jun 2023 12:08:48 +0000 (UTC) X-FDA: 80948406336.14.D0DCC69 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf13.hostedemail.com (Postfix) with ESMTP id 6F6B620022 for <linux-mm@kvack.org>; Tue, 27 Jun 2023 12:08:44 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687867726; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J8leeMhKmOQ7jOYumvmUp9PcrhJvsFWwBwZe5HOZi0M=; b=gnYYIc/tV42bE9a1itXjv70IeRo4VU8UZN4Edp6W+WTnFaTULB6AWYA0iKZhrGKAcg9AQG UCzipwYWxtDhJG03pZCjr/YB50g7bJHUpf18qu6+fMOxZRAla4PPqFEeOlAQcug3sTp1vj ZHjOL0xWvAcl9RHlZVRHeaKEdPfm0p8= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf13.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687867726; a=rsa-sha256; cv=none; b=scnPpVD0KchE2fU8k9UBje+4WMFCvEoQQj3O3dHXZD2yxkA4ys9dWh5i3P2C4gsYFzp1Lv C2vnVYlbSeGGWpd5WIGcz5DPMEWYny/dEZjkpqONR46362PZVSkoqICs9PNuEZxQxTb5ya IttGAFSm76h+fxSfLugLKcpq1DebI5Y= Received: from dggpemm500014.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qr3Pc1D1mzTlP5; Tue, 27 Jun 2023 20:07:48 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 27 Jun 2023 20:08:38 +0800 From: Wupeng Ma <mawupeng1@huawei.com> To: <akpm@linux-foundation.org> CC: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>, <mawupeng1@huawei.com> Subject: [PATCH 2/2] swap: Stop add to avail list is swap is full Date: Tue, 27 Jun 2023 20:08:33 +0800 Message-ID: <20230627120833.2230766-3-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230627120833.2230766-1-mawupeng1@huawei.com> References: <20230627120833.2230766-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: g3oth85ufdhsrjtnbkbi18yqanzjkisj X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6F6B620022 X-HE-Tag: 1687867724-508697 X-HE-Meta: U2FsdGVkX18GIxLtUW2wv5UWX+PJBl5Qq1xWQN71Z1+QPWMWR+D7QSt/1/CFjOAWko8fOOjp/K9XApYEhe/6T4CRyd5Em9TLRynYZazFPWmnMsbRpxGIAhWBUzNIoocwRHbghbOnNsui+D70MaUYA8Gs3HdWfzJRGAIgTE1GjcAp5OLikCFnNuAB1MufGi/l7ri2AhNYLjvo7qpChyX8NUWE2fSKH+XZYKhX6lgIZxnzlD1j456OtdTvB9ssZAijRlybBMXim8OO1uQZKd+KnEKKIMb5mCuIAVwG/xyDj74mXSFlDWeqKRkv8zrvBfyrOOtHqzBBcFCjY6xDMms8YMSQtgnySZBn54QNJ78I5LOl7KVNluXxEKl4iQvBpt31rZrEdgiR2+BWm/OeLJUBwi8OAl3kN+Mt+sCIyl/DftwFFPRL7ydNKDiQWqVefR6Pqw7GIVutHkNQ1E8hWWlFAYhBrR6ueHOkfEaKaZlB/c9RDaOuhfOk74t/ckL5XrSuIeoJEjTA1EqAYn7/wMuKkZeJehLC/CwVrAV8V6xu3Sqr16bRa4xPL3eGvx3T58DU7dMvsoQAyUb6tdVCc0vWR6PSQ8EXtsEHOcD2zBschwgp/uFI00jEHSdjbh+TuzQ8/DZ8+cNPY8p3PUczCqMhcA16/x3onOjam+AF5224dI7NkXj7YTw+ScJU59ib2gWZVuKf/b4PoWWliBIC/WSQBHAeR++9IN17CqnUT5kqgFYZnyJGbtQB/gUIWJsLq0w+pbGMrEOG9d197og2I1tLM7Aw60EpvE0DsNI8OL8cQdaQSDffymaMk65RjQiH3dJhXBtRFbNiCNlr3p4ri2LHH7I5BFN+mbhpQN3QMqyxk4+TFNOqaYPw2eWLzlOhtp05Jqd4WS+UBIkEJIjFKy30Obcnw8cnCjl5ZO3Uyzgg+Nv6crfOacbzDqa6HnQHa/DsxbZAymYWEDdDQ0QgsP2 Uekom+49 c5MOrs7feM0DD95uG0Gzh1HFI95u2BYPnq8S2QO6d79YT53cBIG2dwXW9S3aPbscp1e9nyq1IUGyxmZKJ45JkBnt4XXVCv7bdWVpTBaPWZJHgKgBN+6q/l3/BzCyE0xXGd9o/L3WI0iW/++OtxtXnsG+iP3VVA8yyw8HgrN+I8av3keHMZz7gPHzVIx5ngX3lfzvUx6lwfJ27WYWHta/kthSn+Q== 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: <linux-mm.kvack.org> |
Series |
fix WARN_ON in add_to_avail_list
|
expand
|
diff --git a/mm/swapfile.c b/mm/swapfile.c index 879cb80bf37b..0167999fa228 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2337,7 +2337,10 @@ static void _enable_swap_info(struct swap_info_struct *p) * swap_info_struct. */ plist_add(&p->list, &swap_active_head); - add_to_avail_list(p); + + /* add to avaliable list iff swap device is not full */ + if (p->highest_bit) + add_to_avail_list(p); } static void enable_swap_info(struct swap_info_struct *p, int prio,