Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp613946pxv; Thu, 15 Jul 2021 11:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp+nxWhia40vB9hBgc5n2gNJs8wtTRd68cidGlZSpURyriIfLoOijyv6NT5qMQiYzbgHTj X-Received: by 2002:a5d:87cc:: with SMTP id q12mr4183951ios.131.1626373997739; Thu, 15 Jul 2021 11:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626373997; cv=none; d=google.com; s=arc-20160816; b=lJUkBoaw6BlL4EpnshQpoJX8or5pry7UfsB1loC2aV1TdgAJjHTwa/iN3T3IjkAFlB zSYkKYAce8qREdcjVlFQspuG5U0sjSTKE2nJfsLsYXDgpmwlLoHYjRZq/w/kBJcykTwf suGZPTLQDG6Irl2Hq6KQzl84khXnU4H7hqB1tzzPNLA0YARqasaASGYJndM8Zd4O/3TY 4zlr+CsKOs5zlwgMCPW3eD/kG+XKanpkzT7/sYYf4W+ZCUWvw/6/IHRdvzwBwbeIISMW 5duJzBcKdc+wJojjo2ZQr/8ZdsuFfZt7mgLM0F5yOvpsoqok7GXSXwkI5+3rI4EG6bDh H+cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=a64fucJ3nradLqS8b0xWylaDujzNDAEVUEg6XMLQFh4=; b=m5YKsn0/reaQ/whgIy+jIFSb4PmzSzG77C6mICRDJ99KR9MriTGep97yYfzJUil0n0 Rh0Cxt6SVBT+nBgMdycA//YLsWi8ndGgT+NzJjrN7v4SNMp2p071Q3AinZrK4LlLpOWB bPFXBfHOFKi2TWBneEbS+9RGPLQ1Z4vy1PmOuacgVYyaJ0bgsXvlSv4bkH+vKagaP/CM /nsQNj7dfB16xSI45pEloaorTzCIRWeKa0uFbIvBgUxRJcwTmvdJ5rAGvDIC9LzPMhLr /tQ78mJ8ssk31FqqTrjc/d1/RDeOtv9mm+qQ36G2z1Z/BrXZ39HRWelclSIDxaUOF9+U z3vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="oGH/EaFL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si8153675ioq.17.2021.07.15.11.33.05; Thu, 15 Jul 2021 11:33:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b="oGH/EaFL"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhGOS0C (ORCPT + 99 others); Thu, 15 Jul 2021 14:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238509AbhGOSYx (ORCPT ); Thu, 15 Jul 2021 14:24:53 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E420BC061760 for ; Thu, 15 Jul 2021 11:21:58 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id hd33so10798669ejc.9 for ; Thu, 15 Jul 2021 11:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=a64fucJ3nradLqS8b0xWylaDujzNDAEVUEg6XMLQFh4=; b=oGH/EaFLiAckIljXb9GhTC074m/Bzr0mO99DSaKBORzBZFLFBYKy2BliXNavS0u6La deOvQrRK5tkJf+6NTJlln66+wnNcuKrxrVAodVFuhhIIsVm7aXOAJScpcqwySp61DCz5 5CYoJ8Jo4eEjWkZFHAjmHt4tF/1FfU9Wr4jLoNDz8FUy3twADpH4N1BfFdDKE+6sKLSO WveCBYvueMge/KVLiziNUAfZq0E5LHT3DYZ3AK0U3CCBaiE6bRK5I6rM8580AAOaXraY oNsPEcnyA2zSvUfs/JwkIz37zusaRh8N9SbLr0E8mVtysJuQyWoZDZAFxWCoJUmsQo+v 6pYg== 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=a64fucJ3nradLqS8b0xWylaDujzNDAEVUEg6XMLQFh4=; b=qIHlPCZk7zIEEO6TJJIy1YJ37DZkgQCsAcjR6QoU9/EKXPn/q0UmBvaV04YP2qQEs0 nMnUscYVmiEZFcuQ/ZDqHn/lBTKU6S7cVhkuUStx/nbE1LIXFdFbku3nnNvCOpf6HQGO HReAMj3WlDvDm/+GXpfqJnu+URq0AX6ixHMKFmgydCEgYrSICEvnyTNj9oRncRivNBfT 95qPuRWKusz0BXvZKebS8TeYTSa5ZRkG7GsvXyvkjC8e1H1YsMOW5C0rWm3GKBqW1BVF 6V88/pUX+rgn7z5t32m78IND0RpcF6VKV5eTBdhV/LO8BoMMV7qw+knplURMiCQ3dZu+ ULUA== X-Gm-Message-State: AOAM532KpMahIX9tlCodeWPvqtPDRIYz5+EAmTT2V/OqmLqfO4+F+tK8 gxh+jf5dB4KuZWocCRxRp/wbNCgIoMTW6w9YZc7GVA== X-Received: by 2002:a17:906:fb90:: with SMTP id lr16mr6978465ejb.541.1626373317450; Thu, 15 Jul 2021 11:21:57 -0700 (PDT) MIME-Version: 1.0 References: <343394260f599d940cacc37f1dcc0309239ae220.1626371112.git.zhansayabagdaulet@gmail.com> In-Reply-To: From: Pavel Tatashin Date: Thu, 15 Jul 2021 14:21:21 -0400 Message-ID: Subject: Re: [PATCH 1/2] mm: KSM: fix ksm_run data type To: Matthew Wilcox Cc: Zhansaya Bagdauletkyzy , Andrew Morton , Tyler Hicks , linux-mm , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 15, 2021 at 2:18 PM Matthew Wilcox wrote: > > On Fri, Jul 16, 2021 at 12:01:01AM +0600, Zhansaya Bagdauletkyzy wrote: > > +++ b/mm/ksm.c > > @@ -289,7 +289,7 @@ static int ksm_nr_node_ids = 1; > > #define KSM_RUN_MERGE 1 > > #define KSM_RUN_UNMERGE 2 > > #define KSM_RUN_OFFLINE 4 > > -static unsigned long ksm_run = KSM_RUN_STOP; > > +static unsigned int ksm_run = KSM_RUN_STOP; > > Should this be an enum instead? I think "unsigned int" is OK here, as it is exposed as uint to users: Documentation/ABI/testing/sysfs-kernel-mm-ksm /sys/kernel/mm/ksm/run run: write 0 to disable ksm, read 0 while ksm is disabled. - write 1 to run ksm, read 1 while ksm is running. - write 2 to disable ksm and unmerge all its pages. Pasha