From patchwork Fri Aug 23 18:57:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Usama Arif X-Patchwork-Id: 13775723 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 BDCCAC52D7C for ; Fri, 23 Aug 2024 18:58:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F8E66B02FC; Fri, 23 Aug 2024 14:58:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A9886B0301; Fri, 23 Aug 2024 14:58:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D4936B02FD; Fri, 23 Aug 2024 14:58:50 -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 F0BD66B0173 for ; Fri, 23 Aug 2024 14:58:49 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7B60941711 for ; Fri, 23 Aug 2024 18:58:49 +0000 (UTC) X-FDA: 82484421978.13.9CB62A1 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by imf01.hostedemail.com (Postfix) with ESMTP id A886440010 for ; Fri, 23 Aug 2024 18:58:46 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="iB1aCIM/"; spf=pass (imf01.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.217.48 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724439417; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Sh3UNHRdYk2GVwyEcx3sKj43KmS421jzAbB7K3l/19k=; b=dseZlKHPNlnpCPSOMTlU9Ru4ueCnxbNNCgSA938ri3PHJCJcD7T/GPlBvcO6yjUV47X+V/ iD8wC14Ad52lVftZHA8Ae23QFNIv2EfP5C7fezktQ0XEzZOpeCG0Pqx7iNif2rR2K2xsVK psvnHSttJxeNSfWikh6FW8Cx/wk/mJI= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="iB1aCIM/"; spf=pass (imf01.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.217.48 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724439417; a=rsa-sha256; cv=none; b=f7nW59vVNzpV6N/Tm9MwBU0+5e4DU0oDj1ORgA1GTkkBGfV5+gobUV7y2GSO2GFYTYh+D9 kTuUclH/ZQktQfT/dW+ebn/UPM+zCLRHgry2I1YwJDy4I4X1fQAw86759VGGM2SRqlNHLM sVahZhFNG5i2MaDvffsP3cJkFNzsn2c= Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-498c3d1d788so721573137.3 for ; Fri, 23 Aug 2024 11:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724439525; x=1725044325; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sh3UNHRdYk2GVwyEcx3sKj43KmS421jzAbB7K3l/19k=; b=iB1aCIM/4un/+xLHIldSSQycw1aYS+BYUF0bUvLSs3z+Jtg9aRQ/AsvKSpDhtSZKvW iwvsAvb5hxprmuAiEZuWqo9+GoIHAFdLXxBG/+BSA79H0mr8Ft2Jy+eCvJc5XZGJzv1+ s9HyLEY/BNG/XQf0GAIIGgPVFqhNV/eEXCOj69yYq6RP+IUemvfkLudbV1LsXNNqBrgI j0htrEIptsDiYxNq8r+VfnNiyHnvkkIvawFVDx1OKetq5IKUHc/YfCzpvwm1nSGLx0UC vl/VPI8WvxpSR9OpwVp98wacYCC6Feat4hp0Gm921xJP9++4ZJHO9M5dedDdXsQhpIjM 9ubw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724439525; x=1725044325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sh3UNHRdYk2GVwyEcx3sKj43KmS421jzAbB7K3l/19k=; b=OYcwio3e0ZzIhuv5WQCQtX39CnUCkk2urIptbY3mzD8aqEZ6ZIspZsyMtFjq03p7im rxL6ZyIfjy8MRkwnFIFbJ+0VwcX6aRha09WLDIHGa7DAxRxaOc/Uz1wTQ+a6PVlCxpAN oGaRWPYmQe3bIh/b5tvE+PzmmkNrNC5H/iysmY9LhAM4xXG7XlzknledgKL0zu7RCzXD /RLI10bhCo7BL4bc4iPxuv0M6cAgt/7NYg5nCzAluJzT7RNxGXYEV0a4fugF+GYytv9u w9N8Uqo6ZpZEUPzlYvNWb25U6J40bzGRg1momswavExAZ++sAYwCgMa7vX6XIiPaCabG hCnA== X-Forwarded-Encrypted: i=1; AJvYcCXz3mMpUB8LY8FFfeI2pBClW2FAUkEXMxVIX2RlonRCBEApzpe0ZqNT4l9m9eeHJb8+u1rqeso/pg==@kvack.org X-Gm-Message-State: AOJu0YzDDZPTVm4u2Nqw9ZLO8SwqY/g9rhkTOFKWTE+vnRnLv19JePn1 wt5rVZdBzI8o0oPiNs2BzXswcgPORYZPRVWJ0teKCMrbZyZYDxqw X-Google-Smtp-Source: AGHT+IGc5hKCXhnGMWTJpltPKy/ZsZOxc6pfK2o5GuoEQCbkG2S+TuJrzCD64NbwWD+lZMa3k9r5yA== X-Received: by 2002:a05:6102:3e90:b0:498:f017:14a1 with SMTP id ada2fe7eead31-498f46edc07mr4129469137.19.1724439525395; Fri, 23 Aug 2024 11:58:45 -0700 (PDT) Received: from localhost (fwdproxy-ash-115.fbsv.net. [2a03:2880:20ff:73::face:b00c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c162d643b9sm21266556d6.66.2024.08.23.11.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 11:58:44 -0700 (PDT) From: Usama Arif To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, shakeel.butt@linux.dev, david@redhat.com, ying.huang@intel.com, hughd@google.com, willy@infradead.org, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, Usama Arif , Andi Kleen Subject: [PATCH v8 1/2] mm: store zero pages to be swapped out in a bitmap Date: Fri, 23 Aug 2024 19:57:34 +0100 Message-ID: <20240823185838.939977-2-usamaarif642@gmail.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240823185838.939977-1-usamaarif642@gmail.com> References: <20240823185838.939977-1-usamaarif642@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A886440010 X-Stat-Signature: qm7ghtrxdssijdet8feah1h5iaitzra4 X-Rspam-User: X-HE-Tag: 1724439526-19667 X-HE-Meta: U2FsdGVkX18qKGD8LRRU0f/C1jd2dX76hDeBSO9zjollFC8vWDJK2mixNRmQ4p1H3C33A3Olbceb4rl8Ns2zL4K5f9ITQFt1xhrDRovFfpGh63s0L1s4L93sG9SaBUuho864YlPjAahP6Ra9UoWLRp0kfojRth1KuMd1bZiUSa1KxiE9QCbkjiMNnHS+zscH/YZDAWnYXAgFRsFCj7BwyWk3W7qqqngcY4TM0uaAR5gt6Yg4J2VGPNbldVllnWWIRULP+vPHfYE8uQzPrCHUdroQ9l5HG4W8l/MFDaxDkITrPD3v1tOqY3jl65+eG99wBccqzLadNfDWDj+HagbmlHlKzJztBdLq/fDEjxUPmKX39ttd8BFb61xp6biRa5D7IhLVNDAPD3m2t9MHYwWIbh/bJY/4Rx+o73zLjfGf/wDenqULQFCr2MTkGerfeopCayTch5riBMuOh2Lyx+bRHg4vWXbvM6eUqBVjCAei5zbgzJo+lYv9+FDqgDsppRoewaSOGRSBNUeoRAWecNiCKgrsCSH1S29y8GoJ8EH0mJJ5yvnBy0aGtQHX5OxV9/rLYHMfCfBmMKiEEm90pMoBJYpMCuO15V4XdXerQOnN0OM+QDN0tLfTG2kn6NraU+kQKgwB+4+IdtBfdhuv0D0EjP2IFTHReem6XIcu1ANchNdkbMut0kpEklS1dHifna7WbNEyokwB/BU2/Pp5QmvjRflyXjuToEufXVqJudPow2esKWsrvEP46DwQZxLkiG1qinjPqpi/MKCklr7Ns/2OWdSmjROlj9Y98dk2tay5tRD/k2OnKrs0M+6Jv/SUxcEWpasZXhmFvM/Iihqo5AC959mfliZqReWRYRS8k8A3crLvCVu4UsLpwy8LaVMJVH7XwWfq6mdQd5gmlXsAgoCc3svVLL3m7xRdFekh6KXdjJzuYPYdaCFrH7ZKE6HDs08jVvblbJ+a/3b01Aa4Pn+ mUsV0qp2 qalB9PQFehrQUGn1bNMnRLu9g8+w/y66f7z5H1Pxz0N62ECO/FBYobrMvdYYp+eIp89W/ojf6ZwT3+9N8vQfci29djcw5UyO6/kTeF4I/plGLW5/7VMHTvm2hv1oxB9MyDFfa8fV+u90kqsyCFiz96Yy1WGIlB0HY4/Q1cerhFFA5cFesoiD6KJrtq22QH7SzhvD3nTzrOQnOOhT6oN3WSQ2/cD/odG81AWSUatKqbK+JuR56ahd2M5GrLpWEppCYBMZcaasqTU4bVX5EHmPXJtmntSMmRiFoQx7ld6UIEG+3JMiNBq73RQV0s32X6iOV72eOdg8BBc77GUe4VLT69Qddz8KHeKqkbbzpV3pRB0mVX4kbTa7EI3cnK45T8UKR7NTspXi79ujwv5vyu83SMlIMbXbmy8I0IEPUbEW5TjpTqhDQ75alMP50bHDhTAcyOlYTTRabZFN221BVBdWYmSy3T0dlqXnIPcrPxk6l7uHsAcoO93gSvLRlJPrCIiRWmvZ3jrO/zvfBlpiYC0GloovGB/pTh4gdh3Uun9mrAm8OeMxXRSK3KYLDP4yFnrKCwU/RcP++502SogoRsYX6gfcKAuB2dAOetFj9fe1A+ArC7LkdItnCizs3gU4FK8YvYKQy26VxOq4/sb92ALkzM0K9/Ia9iyKYFVTw 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: Approximately 10-20% of pages to be swapped out are zero pages [1]. Rather than reading/writing these pages to flash resulting in increased I/O and flash wear, a bitmap can be used to mark these pages as zero at write time, and the pages can be filled at read time if the bit corresponding to the page is set. With this patch, NVMe writes in Meta server fleet decreased by almost 10% with conventional swap setup (zswap disabled). [1] https://lore.kernel.org/all/20171018104832epcms5p1b2232e2236258de3d03d1344dde9fce0@epcms5p1/ Signed-off-by: Usama Arif Reviewed-by: Chengming Zhou Reviewed-by: Yosry Ahmed Reviewed-by: Nhat Pham Cc: David Hildenbrand Cc: "Huang, Ying" Cc: Hugh Dickins Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Shakeel Butt Cc: Usama Arif Cc: Andi Kleen Signed-off-by: Andrew Morton Acked-by: Johannes Weiner --- include/linux/swap.h | 1 + mm/page_io.c | 118 ++++++++++++++++++++++++++++++++++++++++++- mm/swapfile.c | 38 ++++++++++++-- 3 files changed, 151 insertions(+), 6 deletions(-) diff --git a/include/linux/swap.h b/include/linux/swap.h index 248db1dd7812..ca533b478c21 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -296,6 +296,7 @@ struct swap_info_struct { signed char type; /* strange name for an index */ unsigned int max; /* extent of the swap_map */ unsigned char *swap_map; /* vmalloc'ed array of usage counts */ + unsigned long *zeromap; /* kvmalloc'ed bitmap to track zero pages */ struct swap_cluster_info *cluster_info; /* cluster info. Only for SSD */ struct list_head free_clusters; /* free clusters list */ struct list_head full_clusters; /* full clusters list */ diff --git a/mm/page_io.c b/mm/page_io.c index a00e2f615118..b6f1519d63b0 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -172,6 +172,80 @@ int generic_swapfile_activate(struct swap_info_struct *sis, goto out; } +static bool is_folio_zero_filled(struct folio *folio) +{ + unsigned int pos, last_pos; + unsigned long *data; + unsigned int i; + + last_pos = PAGE_SIZE / sizeof(*data) - 1; + for (i = 0; i < folio_nr_pages(folio); i++) { + data = kmap_local_folio(folio, i * PAGE_SIZE); + /* + * Check last word first, incase the page is zero-filled at + * the start and has non-zero data at the end, which is common + * in real-world workloads. + */ + if (data[last_pos]) { + kunmap_local(data); + return false; + } + for (pos = 0; pos < last_pos; pos++) { + if (data[pos]) { + kunmap_local(data); + return false; + } + } + kunmap_local(data); + } + + return true; +} + +static void swap_zeromap_folio_set(struct folio *folio) +{ + struct swap_info_struct *sis = swp_swap_info(folio->swap); + swp_entry_t entry; + unsigned int i; + + for (i = 0; i < folio_nr_pages(folio); i++) { + entry = page_swap_entry(folio_page(folio, i)); + set_bit(swp_offset(entry), sis->zeromap); + } +} + +static void swap_zeromap_folio_clear(struct folio *folio) +{ + struct swap_info_struct *sis = swp_swap_info(folio->swap); + swp_entry_t entry; + unsigned int i; + + for (i = 0; i < folio_nr_pages(folio); i++) { + entry = page_swap_entry(folio_page(folio, i)); + clear_bit(swp_offset(entry), sis->zeromap); + } +} + +/* + * Return the index of the first subpage which is not zero-filled + * according to swap_info_struct->zeromap. + * If all pages are zero-filled according to zeromap, it will return + * folio_nr_pages(folio). + */ +static unsigned int swap_zeromap_folio_test(struct folio *folio) +{ + struct swap_info_struct *sis = swp_swap_info(folio->swap); + swp_entry_t entry; + unsigned int i; + + for (i = 0; i < folio_nr_pages(folio); i++) { + entry = page_swap_entry(folio_page(folio, i)); + if (!test_bit(swp_offset(entry), sis->zeromap)) + return i; + } + return i; +} + /* * We may have stale swap cache pages in memory: notice * them here and get rid of the unnecessary final write. @@ -195,6 +269,25 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) folio_unlock(folio); return ret; } + + /* + * Use a bitmap (zeromap) to avoid doing IO for zero-filled pages. + * The bits in zeromap are protected by the locked swapcache folio + * and atomic updates are used to protect against read-modify-write + * corruption due to other zero swap entries seeing concurrent updates. + */ + if (is_folio_zero_filled(folio)) { + swap_zeromap_folio_set(folio); + folio_unlock(folio); + return 0; + } else { + /* + * Clear bits this folio occupies in the zeromap to prevent + * zero data being read in from any previous zero writes that + * occupied the same swap entries. + */ + swap_zeromap_folio_clear(folio); + } if (zswap_store(folio)) { folio_unlock(folio); return 0; @@ -427,6 +520,26 @@ static void sio_read_complete(struct kiocb *iocb, long ret) mempool_free(sio, sio_pool); } +static bool swap_read_folio_zeromap(struct folio *folio) +{ + unsigned int idx = swap_zeromap_folio_test(folio); + + if (idx == 0) + return false; + + /* + * Swapping in a large folio that is partially in the zeromap is not + * currently handled. Return true without marking the folio uptodate so + * that an IO error is emitted (e.g. do_swap_page() will sigbus). + */ + if (WARN_ON_ONCE(idx < folio_nr_pages(folio))) + return true; + + folio_zero_range(folio, 0, folio_size(folio)); + folio_mark_uptodate(folio); + return true; +} + static void swap_read_folio_fs(struct folio *folio, struct swap_iocb **plug) { struct swap_info_struct *sis = swp_swap_info(folio->swap); @@ -517,7 +630,10 @@ void swap_read_folio(struct folio *folio, struct swap_iocb **plug) } delayacct_swapin_start(); - if (zswap_load(folio)) { + if (swap_read_folio_zeromap(folio)) { + folio_unlock(folio); + goto finish; + } else if (zswap_load(folio)) { folio_unlock(folio); goto finish; } diff --git a/mm/swapfile.c b/mm/swapfile.c index aff73a3d0ead..1cfb7c63cdcc 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -940,6 +940,14 @@ static void swap_range_free(struct swap_info_struct *si, unsigned long offset, unsigned long begin = offset; unsigned long end = offset + nr_entries - 1; void (*swap_slot_free_notify)(struct block_device *, unsigned long); + unsigned int i; + + /* + * Use atomic clear_bit operations only on zeromap instead of non-atomic + * bitmap_clear to prevent adjacent bits corruption due to simultaneous writes. + */ + for (i = 0; i < nr_entries; i++) + clear_bit(offset + i, si->zeromap); if (offset < si->lowest_bit) si->lowest_bit = offset; @@ -2607,7 +2615,8 @@ static int swap_node(struct swap_info_struct *si) static void setup_swap_info(struct swap_info_struct *si, int prio, unsigned char *swap_map, - struct swap_cluster_info *cluster_info) + struct swap_cluster_info *cluster_info, + unsigned long *zeromap) { int i; @@ -2632,6 +2641,7 @@ static void setup_swap_info(struct swap_info_struct *si, int prio, } si->swap_map = swap_map; si->cluster_info = cluster_info; + si->zeromap = zeromap; } static void _enable_swap_info(struct swap_info_struct *si) @@ -2660,11 +2670,12 @@ static void _enable_swap_info(struct swap_info_struct *si) static void enable_swap_info(struct swap_info_struct *si, int prio, unsigned char *swap_map, - struct swap_cluster_info *cluster_info) + struct swap_cluster_info *cluster_info, + unsigned long *zeromap) { spin_lock(&swap_lock); spin_lock(&si->lock); - setup_swap_info(si, prio, swap_map, cluster_info); + setup_swap_info(si, prio, swap_map, cluster_info, zeromap); spin_unlock(&si->lock); spin_unlock(&swap_lock); /* @@ -2682,7 +2693,7 @@ static void reinsert_swap_info(struct swap_info_struct *si) { spin_lock(&swap_lock); spin_lock(&si->lock); - setup_swap_info(si, si->prio, si->swap_map, si->cluster_info); + setup_swap_info(si, si->prio, si->swap_map, si->cluster_info, si->zeromap); _enable_swap_info(si); spin_unlock(&si->lock); spin_unlock(&swap_lock); @@ -2707,6 +2718,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) { struct swap_info_struct *p = NULL; unsigned char *swap_map; + unsigned long *zeromap; struct swap_cluster_info *cluster_info; struct file *swap_file, *victim; struct address_space *mapping; @@ -2829,6 +2841,8 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) p->max = 0; swap_map = p->swap_map; p->swap_map = NULL; + zeromap = p->zeromap; + p->zeromap = NULL; cluster_info = p->cluster_info; p->cluster_info = NULL; spin_unlock(&p->lock); @@ -2841,6 +2855,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile) free_percpu(p->cluster_next_cpu); p->cluster_next_cpu = NULL; vfree(swap_map); + kvfree(zeromap); kvfree(cluster_info); /* Destroy swap account information */ swap_cgroup_swapoff(p->type); @@ -3338,6 +3353,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) sector_t span; unsigned long maxpages; unsigned char *swap_map = NULL; + unsigned long *zeromap = NULL; struct swap_cluster_info *cluster_info = NULL; struct page *page = NULL; struct inode *inode = NULL; @@ -3428,6 +3444,17 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) goto bad_swap_unlock_inode; } + /* + * Use kvmalloc_array instead of bitmap_zalloc as the allocation order might + * be above MAX_PAGE_ORDER incase of a large swap file. + */ + zeromap = kvmalloc_array(BITS_TO_LONGS(maxpages), sizeof(long), + GFP_KERNEL | __GFP_ZERO); + if (!zeromap) { + error = -ENOMEM; + goto bad_swap_unlock_inode; + } + if (si->bdev && bdev_stable_writes(si->bdev)) si->flags |= SWP_STABLE_WRITES; @@ -3503,7 +3530,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) if (swap_flags & SWAP_FLAG_PREFER) prio = (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; - enable_swap_info(si, prio, swap_map, cluster_info); + enable_swap_info(si, prio, swap_map, cluster_info, zeromap); pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s\n", K(si->pages), name->name, si->prio, nr_extents, @@ -3538,6 +3565,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) si->flags = 0; spin_unlock(&swap_lock); vfree(swap_map); + kvfree(zeromap); kvfree(cluster_info); if (inced_nr_rotate_swap) atomic_dec(&nr_rotate_swap);