Page MenuHomeFreeBSD

vm_object_coalesce(): do not account holes twice
ClosedPublic

Authored by kib on Wed, Dec 17, 4:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 31, 7:37 AM
Unknown Object (File)
Tue, Dec 30, 6:25 PM
Unknown Object (File)
Tue, Dec 30, 4:54 PM
Unknown Object (File)
Mon, Dec 29, 9:26 PM
Unknown Object (File)
Mon, Dec 29, 8:23 PM
Unknown Object (File)
Mon, Dec 29, 6:59 PM
Unknown Object (File)
Mon, Dec 29, 6:46 PM
Unknown Object (File)
Mon, Dec 29, 6:43 PM
Subscribers

Details

Summary
alc wrote:
Suppose that the object is OBJ_ONEMAPPING and that we, in fact,
have a single mapping to it. Then, we punch a hole in that mapping.
vm_map_entry_delete() only subtracts from the object's charge when
we shrink the size of the object. Now, suppose that we perform
mmap(MAP_ANON) to reallocate some of the hole. Aren't we going to add to
the charge here, even though vm_map_entry_delete() never subtracted from
the charge for the hole that was created?

Only account the change in the charged object size that was added to it.
Also remove ifdef-ed block that tried to correct charge and that is
not needed.


vm_object_coalesce(): simplify common expression

Add next_end variable to replace commonly occuring next_pindex + next_size
expression.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Wed, Dec 17, 4:38 AM
This revision is now accepted and ready to land.Thu, Dec 18, 9:01 PM

P.S. The semester is winding down, so I have more spare time for reviews now.

sys/vm/vm_object.c
2206

I observe that this change introduces even more repetitions of next_pindex + next_size. Should we introduce a next_end?

kib marked an inline comment as done.
kib edited the summary of this revision. (Show Details)

Use next_end

This revision now requires review to proceed.Thu, Dec 18, 10:17 PM
This revision is now accepted and ready to land.Thu, Dec 18, 10:20 PM

I ran the full set of stress2 tests, without seeing any issues.

Re-upload the latest version

This revision now requires review to proceed.Mon, Dec 29, 6:49 PM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Dec 30, 3:26 AM
This revision was automatically updated to reflect the committed changes.