[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-16 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

o...@j.email.ne.jp changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|Open|Closed

--- Comment #16 from o...@j.email.ne.jp ---
(In reply to Konstantin Belousov from comment #15)

I think you already took good pieces out of the patch1 and will be closing this
one.

I'm still testing and check few pieces in patch1 but I am not sure about these
yet.
If they are also useful, I will enter another report and subscribe people who
are in this PR.
I am indeed entering a new one related to sw_nblks, shortly.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-14 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #15 from Konstantin Belousov  ---
(In reply to ota from comment #14)
I definitely did not worked on, and do not plan to do a work on the patch1.  I
am only committing bits which are ready and easy to understand and extract.  I
think that there are some useful ideas left uncommitted in the patch1, which is
why I am asking you to rebase the patch on the current HEAD code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #14 from o...@j.email.ne.jp ---
(In reply to Konstantin Belousov from comment #12)

Thank you for your feedback and comments for the 2nd and 3rd ones.
I wasn't much confident about the change myself.  It is good to hear from a
person who is familiar.
I haven't been paying enough attention to page out and swap out while I read
the code; I will pay more attention to these going forward.


I didn't know you were still working on the 1st one.
Among 3 machines I have and tried, I had one machine that reserved more UMA
zone than requested.
I think "changed" is better than "reduced" in the wording for this case.

i.e. copied from such machine:
Swap blk zone entries reduced from 58663 to 58688.

Or change the wording completely like
Swap blk zone reserved for 58688 entries.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #13 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Fri Oct 13 16:23:05 UTC 2017
New revision: 324600
URL: https://svnweb.freebsd.org/changeset/base/324600

Log:
  Evaluate the real size of the sblk_zone.

  Submitted by: o...@j.email.ne.jp
  PR:   221356
  Reviewed by:  alc, markj
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D12660

Changes:
  head/sys/vm/swap_pager.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #12 from Konstantin Belousov  ---
(In reply to ota from comment #11)
NO_SWAPPING and vm_swap_enabled control the swap-out activity, this is the
action almost unrelated to the page swapping.  If the swap pager zones are left
NULL, then pageout (not swapout) would trap when pagedaemon tries to page out
anonymous memory.  For the same reason the vm_swap_enabled variable cannot be
used to avoid the issue, the variable control the swapping.

In the modern FreeBSD, the process is considered swapped out when all its
threads kernel stacks are marked as pageable.  In this state, the process'
thread is never allowed to be made runnable.  Idea is that non-running process
does not reference its private pages and they are eventually get paged out.

So the two later patches need serious rework.  The first patch is still not
re-merged with the latest HEAD code.  I only found one bit which might be taken
as is from it, see https://reviews.freebsd.org/D12660.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-10 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #11 from o...@j.email.ne.jp ---
Created attachment 187071
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=187071&action=edit
set vm_swap_enabled=1 after swap zones are initialized

This is a proposal and not an complete change.

One purpose is set vm_swap_enabled to 1 after swap initialization is completed.

Another purpose is to avoid/reduce panic().  Given the change tested with
"NO_SWAPPING in vm_pageout()", if we set zones to NULL, we can effectively
disable swapping.

The catch with this change set is 1st uma_zone_reserve_kva() allocated in KVA
for swpctrie_zone won't be freed if 2nd uma_zone_reserve_kva() for swblk_zone
fails and tries to recover.  I couldn't find proper UMA API to release reserved
space.
Also, we may not need to check swblk_zone here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-10 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #10 from o...@j.email.ne.jp ---
Thank you for taking few pieces of the 1st patch.
After your announced changes and these patches got into 11-stable, I've been
experimenting with swap.

I prepared 2 additional patch sets; one is above and the other is below.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-10-10 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #9 from o...@j.email.ne.jp ---
Created attachment 187070
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=187070&action=edit
NO_SWAPPING in vm_pageout()

After some experiments and reading swap_pager.c, we can put NO_SWAPPING macro
to disable swapping.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-09-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #8 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Wed Sep  6 07:06:59 UTC 2017
New revision: 323210
URL: https://svnweb.freebsd.org/changeset/base/323210

Log:
  MFC r323018:
  Adjust interface of swapon_check_swzone() to its actual usage.

  PR:   221356

Changes:
_U  stable/11/
  stable/11/sys/vm/swap_pager.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-09-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #7 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Wed Sep  6 07:04:29 UTC 2017
New revision: 323209
URL: https://svnweb.freebsd.org/changeset/base/323209

Log:
  MFC r323017:
  Make the swap_pager_full variable static.

  PR:   221356

Changes:
_U  stable/11/
  stable/11/sys/vm/swap_pager.c
  stable/11/sys/vm/swap_pager.h

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-30 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #6 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Wed Aug 30 10:17:00 UTC 2017
New revision: 323018
URL: https://svnweb.freebsd.org/changeset/base/323018

Log:
  Adjust interface of swapon_check_swzone() to its actual usage.

  The function return value is not used.  Its argument is always
  swap_total/PAGE_SIZE, so make it not take any arguments.

  Submitted by: o...@j.email.ne.jp
  PR:   221356
  MFC after:1 week

Changes:
  head/sys/vm/swap_pager.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-30 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #5 from Konstantin Belousov  ---
(In reply to commit-hook from comment #4)
As you see, I committed one trivial bit of your patch.  Please re-merge with
the HEAD if needed and put the rest of it on reviews.freebsd.org.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-30 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #4 from commit-h...@freebsd.org ---
A commit references this bug:

Author: kib
Date: Wed Aug 30 09:44:05 UTC 2017
New revision: 323017
URL: https://svnweb.freebsd.org/changeset/base/323017

Log:
  Make the swap_pager_full variable static.

  r290920 removed the use of the variable from vm/vm_pageout.c.

  Submitted by: o...@j.email.ne.jp
  PR:   221356
  MFC after:1 week

Changes:
  head/sys/vm/swap_pager.c
  head/sys/vm/swap_pager.h

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-29 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

Ed Maste  changed:

   What|Removed |Added

 Status|New |Open

--- Comment #3 from Ed Maste  ---
D11435 is now committed with a planned MFC near end of September.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-13 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #2 from o...@j.email.ne.jp ---
Thank you for your feedback.

I looked at https://reviews.freebsd.org/D11435 and my patch doesn't interfere
much yet.

Your side of changes looks quite involved and changes how swap information is
managed.  Do you plan to MFC to 11/stable?

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-12 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

--- Comment #1 from Konstantin Belousov  ---
There is WIP https://reviews.freebsd.org/D11435 which affects significant part
of the patch.  In particular, the zone limiting bits might go out altogether. 
I suggest to wait for D11435 to land, hopefully some time soon, and then rebase
the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"


[Bug 221356] [patch] Improve swapon_check_swzone() function in swap_pager.c

2017-08-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221356

Bug ID: 221356
   Summary: [patch] Improve swapon_check_swzone() function in
swap_pager.c
   Product: Base System
   Version: 11.1-RELEASE
  Hardware: Any
OS: Any
Status: New
  Keywords: patch
  Severity: Affects Only Me
  Priority: ---
 Component: kern
  Assignee: freebsd-bugs@FreeBSD.org
  Reporter: o...@j.email.ne.jp
  Keywords: patch

Created attachment 185184
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=185184&action=edit
Improve swapon_check_swzone() function

Improve swapon_check_swzone() function.

Change to more descriptive swapon_check_swzone() warnings.
#1 Indicate half the size is recommended size.
(I couldn't figure out and don't know why half is recommended, though.)
#2 Advice when the swap device size exceeds the max size.

Convert swap_pager_full to static variable as it is not used in global space.
Add a unit to swap_total description.
Call uma_zone_get_max() to find proper swap_maxpages.
Use swap_maxpages and other global variable in swapon_check_swzone().
Convert swapon_check_swzone() to a void function.


Patch tested on 11.1-RELEASE and compiled on CURRENT of i386.

How to test
$ swapon 
until you exceed these 2 thresholds - half size and the max size.
Easier to test on systems with less memory.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"