{"action":"created","comment":{"url":"https://api.github.com/repos/kata-containers/runtime/pulls/comments/187812980","pull_request_review_id":119666195,"id":187812980,"diff_hunk":"@@ -202,6 +203,28 @@ func (h hypervisor) defaultVCPUs() uint32 {\n \treturn uint32(h.DefaultVCPUs)\n }\n \n+func (h hypervisor) defaultMaxVCPUs() uint32 {\n+\tnumcpus := goruntime.NumCPU()\n+\tmaxvcpus := vc.MaxQemuVCPUs()\n+\n+\tif h.DefaultMaxVCPUs <= 0 {","path":"cli/config.go","position":16,"original_position":16,"commit_id":"ff26a4048405a8a87af2eba10a5e43f495e4f465","original_commit_id":"ff26a4048405a8a87af2eba10a5e43f495e4f465","user":{"login":"egernst","id":20174683,"avatar_url":"https://avatars1.githubusercontent.com/u/20174683?v=4","gravatar_id":"","url":"https://api.github.com/users/egernst","html_url":"https://github.com/egernst","followers_url":"https://api.github.com/users/egernst/followers","following_url":"https://api.github.com/users/egernst/following{/other_user}","gists_url":"https://api.github.com/users/egernst/gists{/gist_id}","starred_url":"https://api.github.com/users/egernst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egernst/subscriptions","organizations_url":"https://api.github.com/users/egernst/orgs","repos_url":"https://api.github.com/users/egernst/repos","events_url":"https://api.github.com/users/egernst/events{/privacy}","received_events_url":"https://api.github.com/users/egernst/received_events","type":"User","site_admin":false},"body":"can the default be negative?","created_at":"2018-05-13T20:52:50Z","updated_at":"2018-05-13T20:59:32Z","html_url":"https://github.com/kata-containers/runtime/pull/296#discussion_r187812980","pull_request_url":"https://api.github.com/repos/kata-containers/runtime/pulls/296","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/comments/187812980"},"html":{"href":"https://github.com/kata-containers/runtime/pull/296#discussion_r187812980"},"pull_request":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/296"}}},"pull_request":{"url":"https://api.github.com/repos/kata-containers/runtime/pulls/296","id":187027945,"html_url":"https://github.com/kata-containers/runtime/pull/296","diff_url":"https://github.com/kata-containers/runtime/pull/296.diff","patch_url":"https://github.com/kata-containers/runtime/pull/296.patch","issue_url":"https://api.github.com/repos/kata-containers/runtime/issues/296","number":296,"state":"open","locked":false,"title":"virtcontainers/qemu: reduce memory footprint","user":{"login":"devimc","id":13009432,"avatar_url":"https://avatars0.githubusercontent.com/u/13009432?v=4","gravatar_id":"","url":"https://api.github.com/users/devimc","html_url":"https://github.com/devimc","followers_url":"https://api.github.com/users/devimc/followers","following_url":"https://api.github.com/users/devimc/following{/other_user}","gists_url":"https://api.github.com/users/devimc/gists{/gist_id}","starred_url":"https://api.github.com/users/devimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devimc/subscriptions","organizations_url":"https://api.github.com/users/devimc/orgs","repos_url":"https://api.github.com/users/devimc/repos","events_url":"https://api.github.com/users/devimc/events{/privacy}","received_events_url":"https://api.github.com/users/devimc/received_events","type":"User","site_admin":false},"body":"There is a relation between the maximum number of vCPUs and the\r\nmemory footprint, if QEMU maxcpus option and kernel nr_cpus\r\ncmdline argument are big, then memory footprint is big, this\r\nissue only occurs if CPU hotplug support is enabled in the kernel,\r\nmight be because of kernel needs to allocate resources to watch all\r\nsockets waiting for a CPU to be connected (ACPI event).\r\n\r\nFor example\r\n\r\n```\r\n+---------------+-------------------------+\r\n|               | Memory Footprint (KB)   |\r\n+---------------+-------------------------+\r\n| NR_CPUS=240   | 186501                  |\r\n+---------------+-------------------------+\r\n| NR_CPUS=8     | 110684                  |\r\n+---------------+-------------------------+\r\n```\r\n\r\nIn order to do not affect CPU hotplug and allow to users to have containers\r\nwith the same number of physical CPUs, this patch tries to mitigate the\r\nbig memory footprint by using the actual number of physical CPUs as the\r\nmaximum number of vCPUs for each container.\r\n\r\nBefore this patch a container with 256MB of RAM\r\n\r\n```\r\n              total        used        free      shared  buff/cache   available\r\nMem:           195M         40M        113M         26M         41M        112M\r\nSwap:            0B          0B          0B\r\n```\r\n\r\nWith this patch\r\n\r\n```\r\n              total        used        free      shared  buff/cache   available\r\nMem:           236M         11M        188M         26M         36M        186M\r\nSwap:            0B          0B          0B\r\n```\r\n\r\nfixes #295\r\n\r\nSigned-off-by: Julio Montes <julio.montes@intel.com>","created_at":"2018-05-09T20:15:05Z","updated_at":"2018-05-13T20:59:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b66a80984522dca8971ac056a37ab25195799bd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kata-containers/runtime/pulls/296/commits","review_comments_url":"https://api.github.com/repos/kata-containers/runtime/pulls/296/comments","review_comment_url":"https://api.github.com/repos/kata-containers/runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kata-containers/runtime/issues/296/comments","statuses_url":"https://api.github.com/repos/kata-containers/runtime/statuses/ff26a4048405a8a87af2eba10a5e43f495e4f465","head":{"label":"devimc:cpu/fixMemFootprint","ref":"cpu/fixMemFootprint","sha":"ff26a4048405a8a87af2eba10a5e43f495e4f465","user":{"login":"devimc","id":13009432,"avatar_url":"https://avatars0.githubusercontent.com/u/13009432?v=4","gravatar_id":"","url":"https://api.github.com/users/devimc","html_url":"https://github.com/devimc","followers_url":"https://api.github.com/users/devimc/followers","following_url":"https://api.github.com/users/devimc/following{/other_user}","gists_url":"https://api.github.com/users/devimc/gists{/gist_id}","starred_url":"https://api.github.com/users/devimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devimc/subscriptions","organizations_url":"https://api.github.com/users/devimc/orgs","repos_url":"https://api.github.com/users/devimc/repos","events_url":"https://api.github.com/users/devimc/events{/privacy}","received_events_url":"https://api.github.com/users/devimc/received_events","type":"User","site_admin":false},"repo":{"id":125065238,"name":"kata-runtime","full_name":"devimc/kata-runtime","owner":{"login":"devimc","id":13009432,"avatar_url":"https://avatars0.githubusercontent.com/u/13009432?v=4","gravatar_id":"","url":"https://api.github.com/users/devimc","html_url":"https://github.com/devimc","followers_url":"https://api.github.com/users/devimc/followers","following_url":"https://api.github.com/users/devimc/following{/other_user}","gists_url":"https://api.github.com/users/devimc/gists{/gist_id}","starred_url":"https://api.github.com/users/devimc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devimc/subscriptions","organizations_url":"https://api.github.com/users/devimc/orgs","repos_url":"https://api.github.com/users/devimc/repos","events_url":"https://api.github.com/users/devimc/events{/privacy}","received_events_url":"https://api.github.com/users/devimc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devimc/kata-runtime","description":"Kata Containers runtimes","fork":true,"url":"https://api.github.com/repos/devimc/kata-runtime","forks_url":"https://api.github.com/repos/devimc/kata-runtime/forks","keys_url":"https://api.github.com/repos/devimc/kata-runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devimc/kata-runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devimc/kata-runtime/teams","hooks_url":"https://api.github.com/repos/devimc/kata-runtime/hooks","issue_events_url":"https://api.github.com/repos/devimc/kata-runtime/issues/events{/number}","events_url":"https://api.github.com/repos/devimc/kata-runtime/events","assignees_url":"https://api.github.com/repos/devimc/kata-runtime/assignees{/user}","branches_url":"https://api.github.com/repos/devimc/kata-runtime/branches{/branch}","tags_url":"https://api.github.com/repos/devimc/kata-runtime/tags","blobs_url":"https://api.github.com/repos/devimc/kata-runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devimc/kata-runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devimc/kata-runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/devimc/kata-runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devimc/kata-runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/devimc/kata-runtime/languages","stargazers_url":"https://api.github.com/repos/devimc/kata-runtime/stargazers","contributors_url":"https://api.github.com/repos/devimc/kata-runtime/contributors","subscribers_url":"https://api.github.com/repos/devimc/kata-runtime/subscribers","subscription_url":"https://api.github.com/repos/devimc/kata-runtime/subscription","commits_url":"https://api.github.com/repos/devimc/kata-runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/devimc/kata-runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/devimc/kata-runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/devimc/kata-runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/devimc/kata-runtime/contents/{+path}","compare_url":"https://api.github.com/repos/devimc/kata-runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devimc/kata-runtime/merges","archive_url":"https://api.github.com/repos/devimc/kata-runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devimc/kata-runtime/downloads","issues_url":"https://api.github.com/repos/devimc/kata-runtime/issues{/number}","pulls_url":"https://api.github.com/repos/devimc/kata-runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/devimc/kata-runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/devimc/kata-runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devimc/kata-runtime/labels{/name}","releases_url":"https://api.github.com/repos/devimc/kata-runtime/releases{/id}","deployments_url":"https://api.github.com/repos/devimc/kata-runtime/deployments","created_at":"2018-03-13T14:34:32Z","updated_at":"2018-05-09T15:35:31Z","pushed_at":"2018-05-13T17:32:03Z","git_url":"git://github.com/devimc/kata-runtime.git","ssh_url":"git@github.com:devimc/kata-runtime.git","clone_url":"https://github.com/devimc/kata-runtime.git","svn_url":"https://github.com/devimc/kata-runtime","homepage":"","size":4004,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kata-containers:master","ref":"master","sha":"90e3ba602789fe67ed91acb6fbd1b3cc0f6d6d84","user":{"login":"kata-containers","id":33289952,"avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"repo":{"id":110539997,"name":"runtime","full_name":"kata-containers/runtime","owner":{"login":"kata-containers","id":33289952,"avatar_url":"https://avatars3.githubusercontent.com/u/33289952?v=4","gravatar_id":"","url":"https://api.github.com/users/kata-containers","html_url":"https://github.com/kata-containers","followers_url":"https://api.github.com/users/kata-containers/followers","following_url":"https://api.github.com/users/kata-containers/following{/other_user}","gists_url":"https://api.github.com/users/kata-containers/gists{/gist_id}","starred_url":"https://api.github.com/users/kata-containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kata-containers/subscriptions","organizations_url":"https://api.github.com/users/kata-containers/orgs","repos_url":"https://api.github.com/users/kata-containers/repos","events_url":"https://api.github.com/users/kata-containers/events{/privacy}","received_events_url":"https://api.github.com/users/kata-containers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kata-containers/runtime","description":"Kata Containers runtimes","fork":false,"url":"https://api.github.com/repos/kata-containers/runtime","forks_url":"https://api.github.com/repos/kata-containers/runtime/forks","keys_url":"https://api.github.com/repos/kata-containers/runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kata-containers/runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kata-containers/runtime/teams","hooks_url":"https://api.github.com/repos/kata-containers/runtime/hooks","issue_events_url":"https://api.github.com/repos/kata-containers/runtime/issues/events{/number}","events_url":"https://api.github.com/repos/kata-containers/runtime/events","assignees_url":"https://api.github.com/repos/kata-containers/runtime/assignees{/user}","branches_url":"https://api.github.com/repos/kata-containers/runtime/branches{/branch}","tags_url":"https://api.github.com/repos/kata-containers/runtime/tags","blobs_url":"https://api.github.com/repos/kata-containers/runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kata-containers/runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kata-containers/runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/kata-containers/runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kata-containers/runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/kata-containers/runtime/languages","stargazers_url":"https://api.github.com/repos/kata-containers/runtime/stargazers","contributors_url":"https://api.github.com/repos/kata-containers/runtime/contributors","subscribers_url":"https://api.github.com/repos/kata-containers/runtime/subscribers","subscription_url":"https://api.github.com/repos/kata-containers/runtime/subscription","commits_url":"https://api.github.com/repos/kata-containers/runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/kata-containers/runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/kata-containers/runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/kata-containers/runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/kata-containers/runtime/contents/{+path}","compare_url":"https://api.github.com/repos/kata-containers/runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kata-containers/runtime/merges","archive_url":"https://api.github.com/repos/kata-containers/runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kata-containers/runtime/downloads","issues_url":"https://api.github.com/repos/kata-containers/runtime/issues{/number}","pulls_url":"https://api.github.com/repos/kata-containers/runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/kata-containers/runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/kata-containers/runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kata-containers/runtime/labels{/name}","releases_url":"https://api.github.com/repos/kata-containers/runtime/releases{/id}","deployments_url":"https://api.github.com/repos/kata-containers/runtime/deployments","created_at":"2017-11-13T11:29:03Z","updated_at":"2018-05-13T14:56:52Z","pushed_at":"2018-05-13T17:32:04Z","git_url":"git://github.com/kata-containers/runtime.git","ssh_url":"git@github.com:kata-containers/runtime.git","clone_url":"https://github.com/kata-containers/runtime.git","svn_url":"https://github.com/kata-containers/runtime","homepage":"","size":4007,"stargazers_count":189,"watchers_count":189,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"archived":false,"open_issues_count":85,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":48,"open_issues":85,"watchers":189,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/296"},"html":{"href":"https://github.com/kata-containers/runtime/pull/296"},"issue":{"href":"https://api.github.com/repos/kata-containers/runtime/issues/296"},"comments":{"href":"https://api.github.com/repos/kata-containers/runtime/issues/296/comments"},"review_comments":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/296/comments"},"review_comment":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kata-containers/runtime/pulls/296/commits"},"statuses":{"href":"https://api.github.com/repos/kata-containers/runtime/statuses/ff26a4048405a8a87af2eba10a5e43f495e4f465"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"egernst"}}