Lines Matching defs:lpc

124 get_valid_victim(lcollection_t *lcol, lprocess_t *lpc)
126 if (lpc == NULL || !lcollection_member(lcol, lpc))
127 lpc = lcol->lcol_lprocess;
132 while (lpc != NULL && lpc->lpc_unscannable != 0)
133 lpc = lpc->lpc_next;
135 return (lpc);
226 unrm_size(lprocess_t *lpc)
228 return (count_pages(lpc->lpc_prpageheader, CP_CLEAR,
375 lprocess_t *lpc = rfd->rfd_data;
377 st_debug(STDL_NORMAL, lpc->lpc_collection, "revoking pagedata for"
378 " process %d\n", (int)lpc->lpc_pid);
379 ASSERT(lpc->lpc_pgdata_fd != -1);
380 lpc->lpc_pgdata_fd = -1;
469 merge_current_pagedata(lprocess_t *lpc,
476 if (lpc->lpc_pgdata_fd < 0 || get_pagedata(&pghp, lpc->lpc_pgdata_fd) !=
481 (int)lpc->lpc_pid);
482 if ((lpc->lpc_pgdata_fd = rfd_open(pathbuf, 1, RFD_PAGEDATA,
483 revoke_pagedata, lpc, O_RDONLY, 0)) < 0 ||
484 get_pagedata(&pghp, lpc->lpc_pgdata_fd) != 0)
487 (int)lpc->lpc_pid);
491 if (cnt != 0 || lpc->lpc_rss != 0)
493 (int)lpc->lpc_pid, (unsigned long long)cnt,
494 (unsigned long long)lpc->lpc_rss);
495 if (lpc->lpc_prpageheader != NULL) {
504 mklmapping(&old, lpc->lpc_prpageheader);
506 OR_pagedata(lpc->lpc_prpageheader, pghp, &mappings_changed);
516 lmapping_dump(lpc->lpc_ignore);
522 free(lpc->lpc_prpageheader);
525 lpc->lpc_prpageheader = pghp;
528 if (cnt != 0 || lpc->lpc_rss != 0)
530 (int)lpc->lpc_pid, (unsigned long long)cnt,
531 (unsigned long long)lpc->lpc_rss);
533 debug("process %d: mappings changed\n", (int)lpc->lpc_pid);
535 mappings_changed_cb(lpc);
596 unignore_mappings(lprocess_t *lpc)
598 lmapping_free(&lpc->lpc_ignore);
602 unignore_referenced_mappings(lprocess_t *lpc)
607 vicaddr = set_prpageheader_cur(&cur, lpc->lpc_prpageheader, NULL, -1);
611 if (lmapping_remove(&lpc->lpc_ignore, cur.pr_addr,
632 lprocess_t *vic, *lpc;
670 lpc = vic;
671 while (lpc != NULL && should_run) {
672 if (merge_current_pagedata(lpc, unignore_mappings) != 0) {
675 (int)lpc->lpc_pid);
678 debug("process %d: %llu/%llukB scannable\n", (int)lpc->lpc_pid,
679 (unsigned long long)(lpc->lpc_unrm = unrm_size(lpc)),
680 (unsigned long long)lpc->lpc_size);
681 col_unrm_size += lpc->lpc_unrm = unrm_size(lpc);
693 unignore_mappings(lpc);
700 unignore_referenced_mappings(lpc);
703 lpc = lpc->lpc_next != NULL ? get_valid_victim(lcol,
704 lpc->lpc_next) : NULL;
707 lpc = vic;
709 while (lpc != NULL && should_run) {
710 if (lpc->lpc_prpageheader != NULL) {
711 (void) count_pages(lpc->lpc_prpageheader,
713 if (lpc->lpc_pgdata_fd >= 0) {
714 if (rfd_close(lpc->lpc_pgdata_fd) != 0)
717 (int)lpc->lpc_pid,
718 lpc->lpc_pgdata_fd);
719 lpc->lpc_pgdata_fd = -1;
722 lpc = lpc->lpc_next != NULL ? get_valid_victim(lcol,
723 lpc->lpc_next) : NULL;
1000 lprocess_t *lpc = rfd->rfd_data;
1002 debug("revoking xmap for process %d\n", (int)lpc->lpc_pid);
1003 ASSERT(lpc->lpc_xmap_fd != -1);
1004 lpc->lpc_xmap_fd = -1;
1012 lpc_xmap_update(lprocess_t *lpc)
1017 free(lpc->lpc_xmap);
1018 lpc->lpc_xmap = NULL;
1019 lpc->lpc_nxmap = -1;
1021 if (lpc->lpc_xmap_fd == -1) {
1025 (int)lpc->lpc_pid);
1026 if ((lpc->lpc_xmap_fd = rfd_open(pathbuf, 1, RFD_XMAP,
1027 revoke_xmap, lpc, O_RDONLY, 0)) < 0)
1033 if (fstat(lpc->lpc_xmap_fd, &st) != 0) {
1035 (void) rfd_close(lpc->lpc_xmap_fd);
1036 lpc->lpc_xmap_fd = -1;
1040 if ((st.st_size % sizeof (*lpc->lpc_xmap)) != 0) {
1042 (void) rfd_close(lpc->lpc_xmap_fd);
1043 lpc->lpc_xmap_fd = -1;
1047 lpc->lpc_xmap = malloc(st.st_size);
1048 if (lpc->lpc_xmap == NULL) {
1050 (void) rfd_close(lpc->lpc_xmap_fd);
1051 lpc->lpc_xmap_fd = -1;
1055 if ((res = pread(lpc->lpc_xmap_fd, lpc->lpc_xmap, st.st_size, 0)) !=
1057 free(lpc->lpc_xmap);
1058 lpc->lpc_xmap = NULL;
1067 lpc->lpc_nxmap = st.st_size / sizeof (*lpc->lpc_xmap);