From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F77C33CB1 for ; Sun, 19 Jan 2020 10:04:30 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 158802072B for ; Sun, 19 Jan 2020 10:04:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vc4Vi4hH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 158802072B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1it7RT-0004Zt-TJ for kernelnewbies@archiver.kernel.org; Sun, 19 Jan 2020 05:04:27 -0500 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1it7Pd-0002RA-HU for kernelnewbies@kernelnewbies.org; Sun, 19 Jan 2020 05:02:33 -0500 Received: by mail-ot1-x332.google.com with SMTP id p8so26162750oth.10 for ; Sun, 19 Jan 2020 02:02:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jq/CnbwAubTFk0de45PJfXb2eDrshP+wOlJ8891pKv8=; b=Vc4Vi4hHvuiVukaH4ZP9PSekJz3lxM4W5DqLHipEPI/S63Y1R0zK14pIU9PFuEZ5Bl tX9/p6zvoBOg6Y5vSq+rSGqGa1lyjy/lIlXxTinMGReYk1SGRbeKPCp0tHpjxL6xq/sb aVfjTI7KP7a75L3dyCi2/KvfX5eB0mngBEP/iF4G8lxdAmZ5Mkc1Gd4b8OWzq/FSlrSd xDGaC6m2ebiavmo8TYTKJ+b4ymx2vAbzJ9JMLTDzaybFtAUew8QUcM1WyJjHcS7SoiZl ERuQJZGLbCIlYLyc3PzDtmacsRaooQ8svlJ9GWBI0+584P1hqwimDIlY5bdA4LfQ5xcL zgjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jq/CnbwAubTFk0de45PJfXb2eDrshP+wOlJ8891pKv8=; b=izcXNT0RsMvRSsnZyTxabCTG/zYmxumnwc9sy9X7ow+0G/smlqrlhx/zt8LeW/S9iB MD7rkXTaFAJWIOdEGzfK3qS75c0IZZwh+C3X3Ruf0mSl0I5msVwt4IGHeK4ot9rDnF3D y3RYN0LMjenH6CT0fhBtz6vYI/T6ZDoe5fv8ILqI13NcNARdk8RVxvCH07O6oWv5yE+6 Tv1plFxd9pL9PosiYeu8q5N8IDt1mo5DU4ihos73b3bq5GT/mtKaX3+HOsOZrPvpW+2e VCMetLbSvp24vFAKpbjex4Ph2WCCt1c323N/emn/w3lnNkcQQ0rTYH3kmVi7uxtemaGi D3uw== X-Gm-Message-State: APjAAAX2XTcOxJXnhfcjxtoRa+IL8kNSi1s3QtpUj9qRPHg6QT7GViR8 pVDNhMBNna94RREgDK5n0ZHow6FpCx+URDiNYYk= X-Google-Smtp-Source: APXvYqyBQELDaEO/MoNOhVifCI0kRXc7tnj/sIeoQfRnH2HKBEuCvzOGaX7S3D4v6hfqJ6iSNNg0JmyPE15VtJ8LktI= X-Received: by 2002:a9d:4692:: with SMTP id z18mr12118114ote.163.1579428091248; Sun, 19 Jan 2020 02:01:31 -0800 (PST) MIME-Version: 1.0 References: <412530.1579360214@turing-police> In-Reply-To: <412530.1579360214@turing-police> From: Sumit Kumar Date: Sun, 19 Jan 2020 15:31:19 +0530 Message-ID: Subject: Re: transfer physical memory page to swap disk To: =?UTF-8?Q?Valdis_Kl=C4=93tnieks?= , Anupam Kapoor , aleixsanchis@hotmail.com Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6099852513874093388==" Errors-To: kernelnewbies-bounces+kernelnewbies=archiver.kernel.org@kernelnewbies.org --===============6099852513874093388== Content-Type: multipart/alternative; boundary="00000000000053ca66059c7b423a" --00000000000053ca66059c7b423a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks a lot for your responses Aleix, Anupam and Valdis. -- Thanks and Regards, Sumit On Sat, 18 Jan 2020 at 20:40, Valdis Kl=C4=93tnieks wrote: > On Wed, 15 Jan 2020 18:23:05 +0530, Anupam Kapoor said: > > On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar > wrote: > > > Does C/C++ provide any API / system call that enables user to force t= he > > > application to transfer some its physical pages to swap disk ? If so, > is it > > > also possible to obtain the least used page using some API ? > > would madvise not serve your needs ? > > There's this word "force" in the question. > > The problem is that madvise() is *advice* to the kernel, not a strict > guarantee. There's a difference between "If you need to move pages > to disk, consider these pages first" and "Move them to disk now, whether > you really wanted to or not". > > --00000000000053ca66059c7b423a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot for your responses Aleix, Anupam and Valdis.= =C2=A0

--
Thanks and Regards,
Sumit<= /div>

On Sat, 18 Jan 2020 at 20:40, Valdis Kl=C4=93tnieks <valdis.kletnieks@vt.edu> wrote:
On Wed, 15 Jan 2020 18:= 23:05 +0530, Anupam Kapoor said:
> On Wed, 15 Jan 2020 at 6:02 PM Sumit Kumar <sumit686215@gmail.com> wrote: > > Does C/C++ provide any API / system call that enables user to for= ce the
> > application to transfer some its physical pages to swap disk ? If= so, is it
> > also possible to obtain the least used page using some API ?
> would madvise not serve your needs ?

There's this word "force" in the question.

The problem is that madvise() is *advice* to the kernel, not a strict
guarantee.=C2=A0 There's a difference between "If you need to move= pages
to disk, consider these pages first" and "Move them to disk now, = whether
you really wanted to or not".

--00000000000053ca66059c7b423a-- --===============6099852513874093388== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============6099852513874093388==--