linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Johannes Weiner <hannes@saeurebad.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Kernel Testers List <kernel-testers@vger.kernel.org>,
	Randy Dunlap <randy.dunlap@oracle.com>
Subject: Re: [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses
Date: Sun, 17 Aug 2008 14:24:00 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0808171359010.24614@blonde.site> (raw)
In-Reply-To: <8763pzygod.fsf@skyscraper.fehenstaub.lan>

On Sun, 17 Aug 2008, Johannes Weiner wrote:
> Hugh Dickins <hugh@veritas.com> writes:
> 
> I will try and help debugging this further.

Thanks!

> > You're right that those pgd_addr_end() etc. loops have an implicit
> > and fragile dependence on the page alignment of addr and end.  They
> > were written that way to maximize efficiency and be homogeneous
> > across the levels, while handling the wrapped end 0 case.  But both
> > fast gup and pagewalk have stumbled on those assumptions recently.
> 
> Yeah, especially since they could cause silent page table corruption :(

Silent?  I guess those'll be the cases we've not heard about ;)

> 
> In this respect, I still think that my patch has a point.  Because yes,
> the looping depends on page aligned boundaries, but we don't check for
> this required dependency and values leading to overruns are able to pass
> through, as explained above.

I don't think the patch you sent had a lot of point: if there is a 
problem, it extends way beyond just the entry to unmap_vmas(); and
really it's not the well-established loops we have to worry about,
it's where people add new ones without thinking about alignment.

If we put alignment BUG_ONs at the start of every such loop,
yes, that would help the new ones to follow the same pattern.
Or if we put alignment VM_BUG_ONs inside p?d_addr_next(), that
might help too - I say VM_BUG_ONs because we don't really want
to slow down the usual config, though that would then miss any
cases of vma corruption in the wild.

But even if we did so, it looks like we go for a long while only
testing the page-aligned cases anyway (which, barring corruption,
is always the case coming from vm_start and vm_end: the exceptions
are things like fault addresses or atypical I/O sizes), which
would not BUG anyway.  As soon as someone does try the unaligned,
we veer off to an unbounded loop and hit something nasty quite
noisily, don't we?

I do think there's a message about review and testing here, but
not a great case for BUGs.  Well, you didn't BUG, you enforced
alignment; but if the input is wrong, you cannot tell whether
to round up or round down in there, so better to BUG or WARN.

Hugh

  reply	other threads:[~2008-08-17 13:24 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-16 19:00 2.6.27-rc3-git3: Reported regressions from 2.6.26 Rafael J. Wysocki
2008-08-16 19:00 ` [Bug #11141] no battery or DC status - Dell i1501 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11191] 2.6.26-git8: spinlock lockup in c1e_idle() Rafael J. Wysocki
2008-08-18 21:45   ` Mikhail Kshevetskiy
2008-08-18 21:54     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11205] x86: 2.6.27-rc1 does not build with gcc-3.2.3 any more Rafael J. Wysocki
2008-08-17  9:12   ` Mikael Pettersson
2008-08-17 10:27     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11209] 2.6.27-rc1 process time accounting Rafael J. Wysocki
2008-08-17  8:07   ` Peter Zijlstra
2008-08-17 12:19     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11189] sky2 WOL broken Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11207] VolanoMark regression with 2.6.27-rc1 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11210] libata badness Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11220] Heavy suspend and io problems in 2.6.27-rc1-00156-g94ad374 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11215] INFO: possible recursive locking detected ps2_command Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11219] KVM modules break emergency reboot Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11224] Only three cores found on quad-core machine Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11245] acpi error on 2.6.27-rc1+ (ACPI Error (dsobject-0501)) Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11230] Kconfig no longer outputs a .config with freshly updated defconfigs Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11228] p54usb broken by commit b19fa1f Rafael J. Wysocki
2008-08-17 21:25   ` Larry Finger
2008-08-16 19:02 ` [Bug #11237] corrupt PMD after resume Rafael J. Wysocki
2008-08-16 23:36   ` Hugh Dickins
2008-08-17 12:18     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11260] Regression: USB memory stick triggers several USB resets before settling with bogus capacity Rafael J. Wysocki
2008-08-16 23:33   ` Hugh Dickins
2008-08-17 12:18     ` Rafael J. Wysocki
2008-08-17 15:03     ` James Bottomley
2008-08-16 19:02 ` [Bug #11254] KVM: fix userspace ABI breakage Rafael J. Wysocki
2008-08-17 18:45   ` Adrian Bunk
2008-08-16 19:02 ` [Bug #11263] Re: 2.6.27-rc2: uvcvideo WARNING after suspend to ram Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11272] BUG: parport_serial in 2.6.27-rc1 for NetMos Technology PCI 9835 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11271] BUG: fealnx in 2.6.27-rc1 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11276] build error: CONFIG_OPTIMIZE_INLINING=y causes gcc 4.2 to do stupid things Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11264] Invalid op opcode in kernel/workqueue Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11282] Please fix x86 defconfig regression Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11278] 2.6.27-rc2: Very odd top: '5124095h kthreadd' display Rafael J. Wysocki
2008-08-16 22:37   ` Grant Coady
2008-08-17  8:07   ` Peter Zijlstra
2008-08-17 12:22     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11279] 2.6.27-rc0 Power Bugs with HP/Compaq Laptops Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11296] 2.6.27-rc2-git4: suspend and power off fails on Asus M3A32-MVP Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11293] 2.6.27-rc2: suspend regression on EeePC Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11308] tbench regression on each kernel release from 2.6.22 -&gt; 2.6.28 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11316] severe performance regression for iptables nat routing Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11323] /proc/diskstats does not contain all disk devices Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11313] Plugging HDMI causes "unable to handle kernel paging request" Rafael J. Wysocki
2008-08-17 19:28   ` Rafał Miłecki
2008-08-17 19:35     ` Rafael J. Wysocki
2008-08-19 21:31     ` Jeremy Fitzhardinge
2008-08-19 23:53     ` Jeremy Fitzhardinge
2008-08-20 11:10       ` Rafał Miłecki
2008-08-20 16:00         ` Jeremy Fitzhardinge
2008-08-20 20:27           ` Rafał Miłecki
2008-08-20 20:46             ` Jeremy Fitzhardinge
2008-08-21 18:13             ` Jeremy Fitzhardinge
2008-08-21 18:34               ` Rafael J. Wysocki
2008-08-21 18:56               ` Hugh Dickins
2008-08-21 18:59                 ` Jeremy Fitzhardinge
2008-08-21 19:07               ` Yinghai Lu
2008-08-16 19:02 ` [Bug #11330] int3: 0000 in tsc_read_refs when using powernow_k7 Rafael J. Wysocki
2008-08-18 17:15   ` Alok Kataria
2008-08-18 18:33     ` Ingo Molnar
2008-08-19  0:22       ` Ingo Molnar
2008-08-19 17:02         ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11336] 2.6.27-rc2:stall while mounting root fs Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11335] 2.6.27-rc2-git5 BUG: unable to handle kernel paging request Rafael J. Wysocki
2008-08-16 23:38   ` Hugh Dickins
2008-08-17  1:06     ` [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses Johannes Weiner
2008-08-17 11:30       ` Hugh Dickins
2008-08-17 12:22         ` Johannes Weiner
2008-08-17 13:24           ` Hugh Dickins [this message]
2008-08-17 14:41             ` Johannes Weiner
2008-08-16 19:02 ` [Bug #11334] myri10ge: use ioremap_wc: compilation failure on ARM Rafael J. Wysocki
2008-08-17  6:27   ` Martin Michlmayr
2008-08-17 12:35     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11333] Rewrite SSB DMA API breaks compilation " Rafael J. Wysocki
2008-08-17 12:21   ` Martin Michlmayr
2008-08-17 12:43     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11337] Warning in during hotplug on 2.6.27-rc2-git5 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11338] ia64 allmodconfig on current mainline Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11341] 2.6.27-rc1 - ext4 e2fsck false prompting for fixing i_size of Inode Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11339] Only one of my cpus seems to powered down by cpufreq Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11340] LTP overnight run resulted in unusable box Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11343] SATA Cold Boot Problems with 2.6.27-rc[23] on nVidia 680i Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11346] kernel BUG at arch/x86/mm/pat.c:233! Rafael J. Wysocki
2008-08-16 20:45   ` Jean Delvare
2008-08-17 12:35     ` Rafael J. Wysocki
2008-08-17 12:46       ` Ingo Molnar
2008-08-16 19:02 ` [Bug #11355] Regression in 2.6.27-rc2 when cross-building the kernel Rafael J. Wysocki
2008-08-16 20:54   ` Larry Finger
2008-08-17 12:39     ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11354] AMD Elan regression with 2.6.27-rc3 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11344] lockdep link failed Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11356] Linux 2.6.27-rc3 - build failure: undefined reference to `.lockdep_count_forward_deps' Rafael J. Wysocki
2008-08-17 13:51 ` 2.6.27-rc3-git3: Reported regressions from 2.6.26 Theodore Tso
2008-08-17 16:33   ` Rafael J. Wysocki
     [not found] ` <200808230019.09040.rjw@sisk.pl>
     [not found]   ` <680ad8bc0808230032g458319b6nbcaddd24ad84f7a4@mail.gmail.com>
2008-08-23 10:26     ` [Bug #11279] 2.6.27-rc0 Power Bugs with HP/Compaq Laptops Rafael J. Wysocki

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=Pine.LNX.4.64.0808171359010.24614@blonde.site \
    --to=hugh@veritas.com \
    --cc=hannes@saeurebad.de \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=rjw@sisk.pl \
    /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;
as well as URLs for NNTP newsgroup(s).