All of lore.kernel.org
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: tim.c.chen@linux.intel.com, aarcange@redhat.com,
	hannes@cmpxchg.org, hdanton@sina.com, hughd@google.com,
	junaids@google.com, mhocko@kernel.org, minchan@kernel.org,
	riel@redhat.com, wenwei.tww@alibaba-inc.com,
	ying.huang@intel.com, mm-commits@vger.kernel.org
Subject: [withdrawn] mm-swap-remove-lock_initialized-flag-from-swap_slots_cache.patch removed from -mm tree
Date: Wed, 04 Oct 2017 14:54:54 -0700	[thread overview]
Message-ID: <59d558ae.RIqaJHh2cKrJirkh%akpm@linux-foundation.org> (raw)


The patch titled
     Subject: mm/swap_slots.c: remove lock_initialized flag from swap_slots_cache
has been removed from the -mm tree.  Its filename was
     mm-swap-remove-lock_initialized-flag-from-swap_slots_cache.patch

This patch was dropped because it was withdrawn

------------------------------------------------------
From: Tim Chen <tim.c.chen@linux.intel.com>
Subject: mm/swap_slots.c: remove lock_initialized flag from swap_slots_cache

We will only reach the lock initialization code in alloc_swap_slot_cache
when the cpu's swap_slots_cache's slots have not been allocated and
swap_slots_cache has not been initialized previously.  So the
lock_initialized check is redundant and unnecessary.  Remove
lock_initialized flag from swap_slots_cache to save memory.

Link: http://lkml.kernel.org/r/867d1fb070644e6d5f0ac7780f63e75259b82cc3.1500677066.git.tim.c.chen@linux.intel.com
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Reported-by: Wenwei Tao <wenwei.tww@alibaba-inc.com>
Cc: Ying Huang <ying.huang@intel.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Hillf Danton <hdanton@sina.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Junaid Shahid <junaids@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/swap_slots.h |    1 -
 mm/swap_slots.c            |    9 ++++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff -puN include/linux/swap_slots.h~mm-swap-remove-lock_initialized-flag-from-swap_slots_cache include/linux/swap_slots.h
--- a/include/linux/swap_slots.h~mm-swap-remove-lock_initialized-flag-from-swap_slots_cache
+++ a/include/linux/swap_slots.h
@@ -10,7 +10,6 @@
 #define THRESHOLD_DEACTIVATE_SWAP_SLOTS_CACHE	(2*SWAP_SLOTS_CACHE_SIZE)
 
 struct swap_slots_cache {
-	bool		lock_initialized;
 	struct mutex	alloc_lock; /* protects slots, nr, cur */
 	swp_entry_t	*slots;
 	int		nr;
diff -puN mm/swap_slots.c~mm-swap-remove-lock_initialized-flag-from-swap_slots_cache mm/swap_slots.c
--- a/mm/swap_slots.c~mm-swap-remove-lock_initialized-flag-from-swap_slots_cache
+++ a/mm/swap_slots.c
@@ -140,11 +140,10 @@ static int alloc_swap_slot_cache(unsigne
 	if (cache->slots || cache->slots_ret)
 		/* cache already allocated */
 		goto out;
-	if (!cache->lock_initialized) {
-		mutex_init(&cache->alloc_lock);
-		spin_lock_init(&cache->free_lock);
-		cache->lock_initialized = true;
-	}
+
+	mutex_init(&cache->alloc_lock);
+	spin_lock_init(&cache->free_lock);
+
 	cache->nr = 0;
 	cache->cur = 0;
 	cache->n_ret = 0;
_

Patches currently in -mm which might be from tim.c.chen@linux.intel.com are

mm-swap-fix-race-conditions-in-swap_slots-cache-init.patch


                 reply	other threads:[~2017-10-04 21:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59d558ae.RIqaJHh2cKrJirkh%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hdanton@sina.com \
    --cc=hughd@google.com \
    --cc=junaids@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=riel@redhat.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=wenwei.tww@alibaba-inc.com \
    --cc=ying.huang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.