mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Andrea Arcangeli <aarcange@redhat.com>,
	Thomas Sattler <tsattler@gmx.de>, Mel Gorman <mgorman@suse.de>
Subject: [58/70] mm: compaction: ensure that the compaction free scanner does not move to the next zone
Date: Mon, 01 Aug 2011 16:19:13 -0700	[thread overview]
Message-ID: <20110801232056.424528149@clark.kroah.org> (raw)
In-Reply-To: <20110801232124.GA15313@kroah.com>

2.6.39-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Mel Gorman <mgorman@suse.de>

commit: 7454f4ba40b419eb999a3c61a99da662bf1a2bb8 upstream

Compaction works with two scanners, a migration and a free scanner.  When
the scanners crossover, migration within the zone is complete.  The
location of the scanner is recorded on each cycle to avoid excesive
scanning.

When a zone is small and mostly reserved, it's very easy for the migration
scanner to be close to the end of the zone.  Then the following situation
can occurs

  o migration scanner isolates some pages near the end of the zone
  o free scanner starts at the end of the zone but finds that the
    migration scanner is already there
  o free scanner gets reinitialised for the next cycle as
    cc->migrate_pfn + pageblock_nr_pages
    moving the free scanner into the next zone
  o migration scanner moves into the next zone

When this happens, NR_ISOLATED accounting goes haywire because some of the
accounting happens against the wrong zone.  One zones counter remains
positive while the other goes negative even though the overall global
count is accurate.  This was reported on X86-32 with !SMP because !SMP
allows the negative counters to be visible.  The fact that it is the bug
should theoritically be possible there.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 mm/compaction.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -144,9 +144,20 @@ static void isolate_freepages(struct zon
 	int nr_freepages = cc->nr_freepages;
 	struct list_head *freelist = &cc->freepages;
 
+	/*
+	 * Initialise the free scanner. The starting point is where we last
+	 * scanned from (or the end of the zone if starting). The low point
+	 * is the end of the pageblock the migration scanner is using.
+	 */
 	pfn = cc->free_pfn;
 	low_pfn = cc->migrate_pfn + pageblock_nr_pages;
-	high_pfn = low_pfn;
+
+	/*
+	 * Take care that if the migration scanner is at the end of the zone
+	 * that the free scanner does not accidentally move to the next zone
+	 * in the next isolation cycle.
+	 */
+	high_pfn = min(low_pfn, pfn);
 
 	/*
 	 * Isolate free pages until enough are available to migrate the



  parent reply	other threads:[~2011-08-01 23:31 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 23:21 [00/70] 2.6.39.4-stable review Greg KH
2011-08-01 23:18 ` [01/70] USB: serial: add IDs for WinChipHead USB->RS232 adapter Greg KH
2011-08-01 23:18 ` [02/70] drm/radeon/kms: free ib pool on module unloading Greg KH
2011-08-01 23:18 ` [03/70] drm/radeon/kms: fix typo in evergreen disp int status register Greg KH
2011-08-01 23:18 ` [04/70] drm/radeon/kms: fix typo in IH_CNTL swap bitfield Greg KH
2011-08-01 23:18 ` [05/70] mm: vmscan: correct check for kswapd sleeping in sleeping_prematurely Greg KH
2011-08-01 23:18 ` [06/70] mm/nommu.c: fix remap_pfn_range() Greg KH
2011-08-01 23:18 ` [07/70] mm: vmscan: evaluate the watermarks against the correct classzone Greg KH
2011-08-01 23:18 ` [08/70] hwmon: (lm95241) Fix chip detection code Greg KH
2011-08-01 23:18 ` [09/70] hwmon: (lm95241) Fix negative temperature results Greg KH
2011-08-01 23:18 ` [10/70] hwmon: (pmbus) Auto-detect temp2 and temp3 registers/attributes Greg KH
2011-08-01 23:18 ` [11/70] hwmon: (pmbus) Drop check for PMBus revision register in probe function Greg KH
2011-08-01 23:18 ` [12/70] hwmon: (pmbus) Improve fan detection Greg KH
2011-08-01 23:18 ` [13/70] hwmon: (pmbus) Use long variables for register to data conversions Greg KH
2011-08-01 23:18 ` [14/70] ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values Greg KH
2011-08-01 23:18 ` [15/70] ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting Greg KH
2011-08-01 23:18 ` [16/70] ASoC: ak4642: fixup snd_soc_update_bits mask for PW_MGMT2 Greg KH
2011-08-01 23:18 ` [17/70] ARM: 6989/1: perf: do not start the PMU when no events are present Greg KH
2011-08-01 23:18 ` [18/70] ARM: pxa168: correct nand pmu setting Greg KH
2011-08-01 23:18 ` [19/70] ARM: pxa910: " Greg KH
2011-08-01 23:18 ` [20/70] ARM: pxa: fix PGSR register address calculation Greg KH
2011-08-01 23:18 ` [21/70] firewire: ohci: do not bind to Pinnacle cards, avert panic Greg KH
2011-08-01 23:18 ` [22/70] Revert: "dell-laptop: Toggle the unsupported hardware killswitch" Greg KH
2011-08-01 23:18 ` [23/70] [media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner Greg KH
2011-08-01 23:18 ` [24/70] [media] tuner-core: fix s_std and s_tuner Greg KH
2011-08-01 23:18 ` [25/70] [media] tuner-core: fix tuner_resume: use t->mode instead of t->type Greg KH
2011-08-01 23:18 ` [26/70] hwmon: (pmbus) Improve auto-detection of temperature status register Greg KH
2011-08-01 23:18 ` [27/70] [media] pvrusb2: fix g/s_tuner support Greg KH
2011-08-01 23:18 ` [28/70] [media] bttv: fix s_tuner for radio Greg KH
2011-08-01 23:18 ` [29/70] fs/partitions/efi.c: corrupted GUID partition tables can cause kernel oops Greg KH
2011-08-01 23:18 ` [30/70] drm/radeon/kms: fix backend map typo on juniper Greg KH
2011-08-01 23:18 ` [31/70] NFSv4.1: update nfs4_fattr_bitmap_maxsz Greg KH
2011-08-01 23:18 ` [32/70] mac80211: fix TKIP replay vulnerability Greg KH
2011-08-01 23:18 ` [33/70] carl9170: add NEC WL300NU-AG usbid Greg KH
2011-08-01 23:18 ` [34/70] rtlwifi: rtl8192cu: Add new USB ID for Netgear WNA1000M Greg KH
2011-08-01 23:18 ` [35/70] SUNRPC: Fix a race between work-queue and rpc_killall_tasks Greg KH
2011-08-01 23:18 ` [36/70] SUNRPC: Fix use of static variable in rpcb_getport_async Greg KH
2011-08-01 23:18 ` [37/70] drm/radeon/kms: add new NI pci ids Greg KH
2011-08-01 23:18 ` [38/70] ath9k: Fix tx throughput drops for AR9003 chips with AES encryption Greg KH
2011-08-01 23:18 ` [39/70] ath5k: fix incorrect use of drvdata in sysfs code Greg KH
2011-08-01 23:18 ` [40/70] ath5k: fix incorrect use of drvdata in PCI suspend/resume code Greg KH
2011-08-01 23:18 ` [41/70] drm/radeon/kms: clean up multiple crtc handling for Greg KH
2011-08-01 23:18 ` [42/70] drm/radeon: fix oops in ttm reserve when pageflipping (v2) Greg KH
2011-08-01 23:18 ` [43/70] GFS2: make sure fallocate bytes is a multiple of blksize Greg KH
2011-08-01 23:18 ` [44/70] [media] Revert "V4L/DVB: cx23885: Enable Message Signaled Interrupts(MSI)" Greg KH
2011-08-01 23:19 ` [45/70] si4713-i2c: avoid potential buffer overflow on si4713 Greg KH
2011-08-01 23:19 ` [46/70] ASoC: Correct WM8994 MICBIAS supply widget hookup Greg KH
2011-08-01 23:19 ` [47/70] ASoC: Fix shift in WM8958 accessory detection default Greg KH
2011-08-01 23:19 ` [48/70] hwmon: (it87) Fix label group removal Greg KH
2011-08-01 23:19 ` [49/70] hwmon: (asus_atk0110) Fix memory leak Greg KH
2011-08-01 23:19 ` [50/70] hwmon: (max1111) Fix race condition causing NULL pointer exception Greg KH
2011-08-01 23:19 ` [51/70] mmc: Added quirks for Ricoh 1180:e823 lower base clock Greg KH
2011-08-01 23:19 ` [52/70] mmc: sdhci-esdhc-imx: SDHCI_CARD_PRESENT does not get Greg KH
2011-08-01 23:19 ` [53/70] x86: Make Dell Latitude E5420 use reboot=pci Greg KH
2011-08-01 23:19 ` [54/70] davinci: DM365 EVM: fix video input mux bits Greg KH
2011-08-01 23:19 ` [55/70] vmscan: fix a livelock in kswapd Greg KH
2011-08-01 23:19 ` [56/70] libata: fix unexpectedly frozen port after ata_eh_reset() Greg KH
2011-08-01 23:19 ` [57/70] ext4: fix oops in ext4_quota_off() Greg KH
2011-08-01 23:19 ` Greg KH [this message]
2011-08-01 23:19 ` [59/70] mm: vmscan: do not use page_count without a page pin Greg KH
2011-08-01 23:19 ` [60/70] [stable] [PATCH 3/3] mm: compaction: abort compaction if too many pages are isolated and caller is asynchronous V2 Greg KH
2011-08-01 23:19 ` [61/70] xfs [stable only]: restart busy extent search after node removal Greg KH
2011-08-01 23:19 ` [62/70] cifs: clean up wsize negotiation and allow for larger wsize Greg KH
2011-08-01 23:19 ` [63/70] mm: vmscan: do not apply pressure to slab if we are not applying pressure to zone Greg KH
2011-08-01 23:19 ` [64/70] mm: vmscan: only read new_classzone_idx from pgdat when reclaiming successfully Greg KH
2011-08-01 23:19 ` [65/70] Revert "DiBxxxx: get rid of DMA buffer on stack" Greg KH
2011-08-01 23:19 ` [66/70] vfs: fix race in rcu lookup of pruned dentry Greg KH
2011-08-01 23:19 ` [67/70] cifs: fix wsize negotiation to respect max buffer size and Greg KH
2011-08-01 23:19 ` [68/70] cifs: lower default and max wsize to what 2.6.39 can handle Greg KH
2011-08-01 23:19 ` [69/70] bridge: send proper message_age in config BPDU Greg KH
2011-08-01 23:19 ` [70/70] gro: Only reset frag0 when skb can be pulled Greg KH

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=20110801232056.424528149@clark.kroah.org \
    --to=gregkh@suse.de \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tsattler@gmx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®