Page MenuHomeFreeBSD

vm_object_coalesce(): do not account holes twice
AcceptedPublic

Authored by kib on Wed, Dec 17, 4:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 18, 9:25 PM
Unknown Object (File)
Wed, Dec 17, 9:47 PM
Unknown Object (File)
Wed, Dec 17, 3:23 PM
Unknown Object (File)
Wed, Dec 17, 1:13 PM
Unknown Object (File)
Wed, Dec 17, 9:22 AM
Unknown Object (File)
Wed, Dec 17, 4:53 AM
Subscribers

Details

Reviewers
alc
markj
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
2204

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