kernel-testers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes-BfM5BwqdGSkPyMaTEpOvjQ@public.gmane.org>
To: Hugh Dickins <hugh-DTz5qymZ9yRBDgjK7y7TUQ@public.gmane.org>
Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Kernel Testers List
	<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Randy Dunlap
	<randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses
Date: Sun, 17 Aug 2008 16:41:31 +0200	[thread overview]
Message-ID: <87bpzrd7qc.fsf@skyscraper.fehenstaub.lan> (raw)
In-Reply-To: <Pine.LNX.4.64.0808171359010.24614-popGQ1T0qN76K7/ahGyk6A@public.gmane.org> (Hugh Dickins's message of "Sun, 17 Aug 2008 14:24:00 +0100 (BST)")

Hi,

Hugh Dickins <hugh-DTz5qymZ9yRBDgjK7y7TUQ@public.gmane.org> writes:

> On Sun, 17 Aug 2008, Johannes Weiner wrote:
>> Hugh Dickins <hugh-DTz5qymZ9yRBDgjK7y7TUQ@public.gmane.org> 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 ;)

Or we couldn't associate the problem with the source :)

>> 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.

The loops might have been there for long but the usage and input is
prone to change.

For example remap_pfn_range is used by drivers and it has the same
alignment requirements.  Perhaps an explicit comment in the kerneldoc?

Iff there is even a problem with all these things, still looking through
callsites, rereading your mails and thinking about it..  Hey, this thing
is big and I try hard to get a clue ;)

> 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?

Yeah, I think so.

> 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.

Agreed.  Well, in the unmap_vmas() case you can not unmap partial pages,
so you would probably be able to guess correct.  But I agree it should
be up to the callsite.

	Hannes

  parent reply	other threads:[~2008-08-17 14:41 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 #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
     [not found]     ` <18599.60267.441793.686251-gq7oiAaKCbRt3AgVzhmPzw@public.gmane.org>
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 #11207] VolanoMark regression with 2.6.27-rc1 Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11189] sky2 WOL broken 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
     [not found]     ` <20080819014544.390ff3c2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-18 21:54       ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11219] KVM modules break emergency reboot Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11210] libata badness 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 #11215] INFO: possible recursive locking detected ps2_command 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 #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
     [not found]     ` <Pine.LNX.4.64.0808170033330.25704-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
2008-08-17 12:18       ` 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 #11260] Regression: USB memory stick triggers several USB resets before settling with bogus capacity Rafael J. Wysocki
2008-08-16 23:33   ` Hugh Dickins
     [not found]     ` <Pine.LNX.4.64.0808170028550.25704-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
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 #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 #11272] BUG: parport_serial in 2.6.27-rc1 for NetMos Technology PCI 9835 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 #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 #11282] Please fix x86 defconfig regression 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 #11293] 2.6.27-rc2: suspend regression on EeePC 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 #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
     [not found]     ` <b170af450808171228i37951c6vd77071da7584669b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-17 19:35       ` Rafael J. Wysocki
2008-08-19 21:31       ` Jeremy Fitzhardinge
2008-08-19 23:53       ` Jeremy Fitzhardinge
     [not found]         ` <48AB5D17.5030600-TSDbQ3PG+2Y@public.gmane.org>
2008-08-20 11:10           ` Rafał Miłecki
     [not found]             ` <b170af450808200410v3d7cd076h3e62546b48ddf507-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-20 16:00               ` Jeremy Fitzhardinge
     [not found]                 ` <48AC3FA4.9080603-TSDbQ3PG+2Y@public.gmane.org>
2008-08-20 20:27                   ` Rafał Miłecki
     [not found]                     ` <b170af450808201327q48b5b2e0n319c89b0fc1759b6-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-08-20 20:46                       ` Jeremy Fitzhardinge
2008-08-21 18:13                       ` Jeremy Fitzhardinge
     [not found]                         ` <48ADB041.9040806-TSDbQ3PG+2Y@public.gmane.org>
2008-08-21 18:34                           ` Rafael J. Wysocki
2008-08-21 18:56                           ` Hugh Dickins
     [not found]                             ` <Pine.LNX.4.64.0808211946300.28535-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
2008-08-21 18:59                               ` Jeremy Fitzhardinge
2008-08-21 19:07                           ` Yinghai Lu
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
     [not found]     ` <Pine.LNX.4.64.0808170036400.25704-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
2008-08-17  1:06       ` [PATCH] mm: make unmap_vmas() handle non-page-aligned boundary addresses Johannes Weiner
     [not found]         ` <87fxp4pi0r.fsf_-_-ChBp1PjnKaFMLiIyqJsA6Zcj/bVcIWpj/z7RTEddyNg@public.gmane.org>
2008-08-17 11:30           ` Hugh Dickins
     [not found]             ` <Pine.LNX.4.64.0808171151190.13521-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
2008-08-17 12:22               ` Johannes Weiner
     [not found]                 ` <8763pzygod.fsf-ChBp1PjnKaFMLiIyqJsA6Zcj/bVcIWpj/z7RTEddyNg@public.gmane.org>
2008-08-17 13:24                   ` Hugh Dickins
     [not found]                     ` <Pine.LNX.4.64.0808171359010.24614-popGQ1T0qN76K7/ahGyk6A@public.gmane.org>
2008-08-17 14:41                       ` Johannes Weiner [this message]
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
     [not found]       ` <20080818183328.GB22989-X9Un+BFzKDI@public.gmane.org>
2008-08-19  0:22         ` Ingo Molnar
     [not found]           ` <20080819002232.GF9914-X9Un+BFzKDI@public.gmane.org>
2008-08-19 17:02             ` 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 #11333] Rewrite SSB DMA API breaks compilation on ARM Rafael J. Wysocki
2008-08-17 12:21   ` Martin Michlmayr
     [not found]     ` <20080817122134.GG5486-u+sgIaa8TU6A7rR/f+Zz5kHK5LHFu9C3@public.gmane.org>
2008-08-17 12:43       ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11334] myri10ge: use ioremap_wc: compilation failure " Rafael J. Wysocki
2008-08-17  6:27   ` Martin Michlmayr
     [not found]     ` <20080817062724.GA2563-u+sgIaa8TU6A7rR/f+Zz5kHK5LHFu9C3@public.gmane.org>
2008-08-17 12:35       ` 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 #11338] ia64 allmodconfig on current mainline 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 #11339] Only one of my cpus seems to powered down by cpufreq 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 #11354] AMD Elan regression with 2.6.27-rc3 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
     [not found]     ` <20080816224526.43145f77-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-08-17 12:35       ` Rafael J. Wysocki
     [not found]         ` <200808171435.57225.rjw-KKrjLPT3xs0@public.gmane.org>
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
     [not found]     ` <48A73E78.7040907-tQ5ms3gMjBLk1uMJSBkQmQ@public.gmane.org>
2008-08-17 12:39       ` Rafael J. Wysocki
2008-08-16 19:02 ` [Bug #11344] lockdep link failed 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 #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
     [not found]   ` <20080817135134.GA8162-3s7WtUTddSA@public.gmane.org>
2008-08-17 16:33     ` Rafael J. Wysocki
     [not found] ` <200808230019.09040.rjw@sisk.pl>
     [not found]   ` <680ad8bc0808230032g458319b6nbcaddd24ad84f7a4@mail.gmail.com>
     [not found]     ` <680ad8bc0808230032g458319b6nbcaddd24ad84f7a4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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=87bpzrd7qc.fsf@skyscraper.fehenstaub.lan \
    --to=hannes-bfm5bwqdgskpymatepovjq@public.gmane.org \
    --cc=hugh-DTz5qymZ9yRBDgjK7y7TUQ@public.gmane.org \
    --cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    /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).