Commit 98808644 authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

dlm: remove allocation parameter in msg allocation

Remove the context parameter for message allocations and
always use GFP_ATOMIC. This prepares for softirq message
processing.
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent ca0dcef7
...@@ -3330,8 +3330,7 @@ int dlm_unlock(dlm_lockspace_t *lockspace, ...@@ -3330,8 +3330,7 @@ int dlm_unlock(dlm_lockspace_t *lockspace,
static int _create_message(struct dlm_ls *ls, int mb_len, static int _create_message(struct dlm_ls *ls, int mb_len,
int to_nodeid, int mstype, int to_nodeid, int mstype,
struct dlm_message **ms_ret, struct dlm_message **ms_ret,
struct dlm_mhandle **mh_ret, struct dlm_mhandle **mh_ret)
gfp_t allocation)
{ {
struct dlm_message *ms; struct dlm_message *ms;
struct dlm_mhandle *mh; struct dlm_mhandle *mh;
...@@ -3341,7 +3340,7 @@ static int _create_message(struct dlm_ls *ls, int mb_len, ...@@ -3341,7 +3340,7 @@ static int _create_message(struct dlm_ls *ls, int mb_len,
pass into midcomms_commit and a message buffer (mb) that we pass into midcomms_commit and a message buffer (mb) that we
write our data into */ write our data into */
mh = dlm_midcomms_get_mhandle(to_nodeid, mb_len, allocation, &mb); mh = dlm_midcomms_get_mhandle(to_nodeid, mb_len, &mb);
if (!mh) if (!mh)
return -ENOBUFS; return -ENOBUFS;
...@@ -3363,8 +3362,7 @@ static int _create_message(struct dlm_ls *ls, int mb_len, ...@@ -3363,8 +3362,7 @@ static int _create_message(struct dlm_ls *ls, int mb_len,
static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb, static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb,
int to_nodeid, int mstype, int to_nodeid, int mstype,
struct dlm_message **ms_ret, struct dlm_message **ms_ret,
struct dlm_mhandle **mh_ret, struct dlm_mhandle **mh_ret)
gfp_t allocation)
{ {
int mb_len = sizeof(struct dlm_message); int mb_len = sizeof(struct dlm_message);
...@@ -3385,7 +3383,7 @@ static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb, ...@@ -3385,7 +3383,7 @@ static int create_message(struct dlm_rsb *r, struct dlm_lkb *lkb,
} }
return _create_message(r->res_ls, mb_len, to_nodeid, mstype, return _create_message(r->res_ls, mb_len, to_nodeid, mstype,
ms_ret, mh_ret, allocation); ms_ret, mh_ret);
} }
/* further lowcomms enhancements or alternate implementations may make /* further lowcomms enhancements or alternate implementations may make
...@@ -3454,7 +3452,7 @@ static int send_common(struct dlm_rsb *r, struct dlm_lkb *lkb, int mstype) ...@@ -3454,7 +3452,7 @@ static int send_common(struct dlm_rsb *r, struct dlm_lkb *lkb, int mstype)
if (error) if (error)
return error; return error;
error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh, GFP_NOFS); error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh);
if (error) if (error)
goto fail; goto fail;
...@@ -3514,8 +3512,7 @@ static int send_grant(struct dlm_rsb *r, struct dlm_lkb *lkb) ...@@ -3514,8 +3512,7 @@ static int send_grant(struct dlm_rsb *r, struct dlm_lkb *lkb)
to_nodeid = lkb->lkb_nodeid; to_nodeid = lkb->lkb_nodeid;
error = create_message(r, lkb, to_nodeid, DLM_MSG_GRANT, &ms, &mh, error = create_message(r, lkb, to_nodeid, DLM_MSG_GRANT, &ms, &mh);
GFP_NOFS);
if (error) if (error)
goto out; goto out;
...@@ -3536,8 +3533,7 @@ static int send_bast(struct dlm_rsb *r, struct dlm_lkb *lkb, int mode) ...@@ -3536,8 +3533,7 @@ static int send_bast(struct dlm_rsb *r, struct dlm_lkb *lkb, int mode)
to_nodeid = lkb->lkb_nodeid; to_nodeid = lkb->lkb_nodeid;
error = create_message(r, NULL, to_nodeid, DLM_MSG_BAST, &ms, &mh, error = create_message(r, NULL, to_nodeid, DLM_MSG_BAST, &ms, &mh);
GFP_NOFS);
if (error) if (error)
goto out; goto out;
...@@ -3562,8 +3558,7 @@ static int send_lookup(struct dlm_rsb *r, struct dlm_lkb *lkb) ...@@ -3562,8 +3558,7 @@ static int send_lookup(struct dlm_rsb *r, struct dlm_lkb *lkb)
if (error) if (error)
return error; return error;
error = create_message(r, NULL, to_nodeid, DLM_MSG_LOOKUP, &ms, &mh, error = create_message(r, NULL, to_nodeid, DLM_MSG_LOOKUP, &ms, &mh);
GFP_NOFS);
if (error) if (error)
goto fail; goto fail;
...@@ -3587,8 +3582,7 @@ static int send_remove(struct dlm_rsb *r) ...@@ -3587,8 +3582,7 @@ static int send_remove(struct dlm_rsb *r)
to_nodeid = dlm_dir_nodeid(r); to_nodeid = dlm_dir_nodeid(r);
error = create_message(r, NULL, to_nodeid, DLM_MSG_REMOVE, &ms, &mh, error = create_message(r, NULL, to_nodeid, DLM_MSG_REMOVE, &ms, &mh);
GFP_ATOMIC);
if (error) if (error)
goto out; goto out;
...@@ -3609,7 +3603,7 @@ static int send_common_reply(struct dlm_rsb *r, struct dlm_lkb *lkb, ...@@ -3609,7 +3603,7 @@ static int send_common_reply(struct dlm_rsb *r, struct dlm_lkb *lkb,
to_nodeid = lkb->lkb_nodeid; to_nodeid = lkb->lkb_nodeid;
error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh, GFP_NOFS); error = create_message(r, lkb, to_nodeid, mstype, &ms, &mh);
if (error) if (error)
goto out; goto out;
...@@ -3651,8 +3645,7 @@ static int send_lookup_reply(struct dlm_ls *ls, ...@@ -3651,8 +3645,7 @@ static int send_lookup_reply(struct dlm_ls *ls,
struct dlm_mhandle *mh; struct dlm_mhandle *mh;
int error, nodeid = le32_to_cpu(ms_in->m_header.h_nodeid); int error, nodeid = le32_to_cpu(ms_in->m_header.h_nodeid);
error = create_message(r, NULL, nodeid, DLM_MSG_LOOKUP_REPLY, &ms, &mh, error = create_message(r, NULL, nodeid, DLM_MSG_LOOKUP_REPLY, &ms, &mh);
GFP_NOFS);
if (error) if (error)
goto out; goto out;
...@@ -6103,7 +6096,7 @@ static int send_purge(struct dlm_ls *ls, int nodeid, int pid) ...@@ -6103,7 +6096,7 @@ static int send_purge(struct dlm_ls *ls, int nodeid, int pid)
int error; int error;
error = _create_message(ls, sizeof(struct dlm_message), nodeid, error = _create_message(ls, sizeof(struct dlm_message), nodeid,
DLM_MSG_PURGE, &ms, &mh, GFP_NOFS); DLM_MSG_PURGE, &ms, &mh);
if (error) if (error)
return error; return error;
ms->m_nodeid = cpu_to_le32(nodeid); ms->m_nodeid = cpu_to_le32(nodeid);
......
...@@ -1229,14 +1229,13 @@ static struct writequeue_entry *new_wq_entry(struct connection *con, int len, ...@@ -1229,14 +1229,13 @@ static struct writequeue_entry *new_wq_entry(struct connection *con, int len,
}; };
static struct dlm_msg *dlm_lowcomms_new_msg_con(struct connection *con, int len, static struct dlm_msg *dlm_lowcomms_new_msg_con(struct connection *con, int len,
gfp_t allocation, char **ppc, char **ppc, void (*cb)(void *data),
void (*cb)(void *data),
void *data) void *data)
{ {
struct writequeue_entry *e; struct writequeue_entry *e;
struct dlm_msg *msg; struct dlm_msg *msg;
msg = dlm_allocate_msg(allocation); msg = dlm_allocate_msg();
if (!msg) if (!msg)
return NULL; return NULL;
...@@ -1261,9 +1260,8 @@ static struct dlm_msg *dlm_lowcomms_new_msg_con(struct connection *con, int len, ...@@ -1261,9 +1260,8 @@ static struct dlm_msg *dlm_lowcomms_new_msg_con(struct connection *con, int len,
* dlm_lowcomms_commit_msg which is a must call if success * dlm_lowcomms_commit_msg which is a must call if success
*/ */
#ifndef __CHECKER__ #ifndef __CHECKER__
struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation, struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, char **ppc,
char **ppc, void (*cb)(void *data), void (*cb)(void *data), void *data)
void *data)
{ {
struct connection *con; struct connection *con;
struct dlm_msg *msg; struct dlm_msg *msg;
...@@ -1284,7 +1282,7 @@ struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation, ...@@ -1284,7 +1282,7 @@ struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation,
return NULL; return NULL;
} }
msg = dlm_lowcomms_new_msg_con(con, len, allocation, ppc, cb, data); msg = dlm_lowcomms_new_msg_con(con, len, ppc, cb, data);
if (!msg) { if (!msg) {
srcu_read_unlock(&connections_srcu, idx); srcu_read_unlock(&connections_srcu, idx);
return NULL; return NULL;
...@@ -1348,8 +1346,8 @@ int dlm_lowcomms_resend_msg(struct dlm_msg *msg) ...@@ -1348,8 +1346,8 @@ int dlm_lowcomms_resend_msg(struct dlm_msg *msg)
if (msg->retransmit) if (msg->retransmit)
return 1; return 1;
msg_resend = dlm_lowcomms_new_msg_con(msg->entry->con, msg->len, msg_resend = dlm_lowcomms_new_msg_con(msg->entry->con, msg->len, &ppc,
GFP_ATOMIC, &ppc, NULL, NULL); NULL, NULL);
if (!msg_resend) if (!msg_resend)
return -ENOMEM; return -ENOMEM;
......
...@@ -39,9 +39,8 @@ void dlm_lowcomms_stop(void); ...@@ -39,9 +39,8 @@ void dlm_lowcomms_stop(void);
void dlm_lowcomms_init(void); void dlm_lowcomms_init(void);
void dlm_lowcomms_exit(void); void dlm_lowcomms_exit(void);
int dlm_lowcomms_close(int nodeid); int dlm_lowcomms_close(int nodeid);
struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, gfp_t allocation, struct dlm_msg *dlm_lowcomms_new_msg(int nodeid, int len, char **ppc,
char **ppc, void (*cb)(void *data), void (*cb)(void *data), void *data);
void *data);
void dlm_lowcomms_commit_msg(struct dlm_msg *msg); void dlm_lowcomms_commit_msg(struct dlm_msg *msg);
void dlm_lowcomms_put_msg(struct dlm_msg *msg); void dlm_lowcomms_put_msg(struct dlm_msg *msg);
int dlm_lowcomms_resend_msg(struct dlm_msg *msg); int dlm_lowcomms_resend_msg(struct dlm_msg *msg);
......
...@@ -130,9 +130,9 @@ void dlm_free_lkb(struct dlm_lkb *lkb) ...@@ -130,9 +130,9 @@ void dlm_free_lkb(struct dlm_lkb *lkb)
kmem_cache_free(lkb_cache, lkb); kmem_cache_free(lkb_cache, lkb);
} }
struct dlm_mhandle *dlm_allocate_mhandle(gfp_t allocation) struct dlm_mhandle *dlm_allocate_mhandle(void)
{ {
return kmem_cache_alloc(mhandle_cache, allocation); return kmem_cache_alloc(mhandle_cache, GFP_ATOMIC);
} }
void dlm_free_mhandle(struct dlm_mhandle *mhandle) void dlm_free_mhandle(struct dlm_mhandle *mhandle)
...@@ -150,9 +150,9 @@ void dlm_free_writequeue(struct writequeue_entry *writequeue) ...@@ -150,9 +150,9 @@ void dlm_free_writequeue(struct writequeue_entry *writequeue)
kmem_cache_free(writequeue_cache, writequeue); kmem_cache_free(writequeue_cache, writequeue);
} }
struct dlm_msg *dlm_allocate_msg(gfp_t allocation) struct dlm_msg *dlm_allocate_msg(void)
{ {
return kmem_cache_alloc(msg_cache, allocation); return kmem_cache_alloc(msg_cache, GFP_ATOMIC);
} }
void dlm_free_msg(struct dlm_msg *msg) void dlm_free_msg(struct dlm_msg *msg)
......
...@@ -20,11 +20,11 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls); ...@@ -20,11 +20,11 @@ struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls);
void dlm_free_lkb(struct dlm_lkb *l); void dlm_free_lkb(struct dlm_lkb *l);
char *dlm_allocate_lvb(struct dlm_ls *ls); char *dlm_allocate_lvb(struct dlm_ls *ls);
void dlm_free_lvb(char *l); void dlm_free_lvb(char *l);
struct dlm_mhandle *dlm_allocate_mhandle(gfp_t allocation); struct dlm_mhandle *dlm_allocate_mhandle(void);
void dlm_free_mhandle(struct dlm_mhandle *mhandle); void dlm_free_mhandle(struct dlm_mhandle *mhandle);
struct writequeue_entry *dlm_allocate_writequeue(void); struct writequeue_entry *dlm_allocate_writequeue(void);
void dlm_free_writequeue(struct writequeue_entry *writequeue); void dlm_free_writequeue(struct writequeue_entry *writequeue);
struct dlm_msg *dlm_allocate_msg(gfp_t allocation); struct dlm_msg *dlm_allocate_msg(void);
void dlm_free_msg(struct dlm_msg *msg); void dlm_free_msg(struct dlm_msg *msg);
struct dlm_callback *dlm_allocate_cb(void); struct dlm_callback *dlm_allocate_cb(void);
void dlm_free_cb(struct dlm_callback *cb); void dlm_free_cb(struct dlm_callback *cb);
......
...@@ -379,8 +379,7 @@ static int dlm_send_ack(int nodeid, uint32_t seq) ...@@ -379,8 +379,7 @@ static int dlm_send_ack(int nodeid, uint32_t seq)
struct dlm_msg *msg; struct dlm_msg *msg;
char *ppc; char *ppc;
msg = dlm_lowcomms_new_msg(nodeid, mb_len, GFP_ATOMIC, &ppc, msg = dlm_lowcomms_new_msg(nodeid, mb_len, &ppc, NULL, NULL);
NULL, NULL);
if (!msg) if (!msg)
return -ENOMEM; return -ENOMEM;
...@@ -428,7 +427,7 @@ static int dlm_send_fin(struct midcomms_node *node, ...@@ -428,7 +427,7 @@ static int dlm_send_fin(struct midcomms_node *node,
struct dlm_mhandle *mh; struct dlm_mhandle *mh;
char *ppc; char *ppc;
mh = dlm_midcomms_get_mhandle(node->nodeid, mb_len, GFP_ATOMIC, &ppc); mh = dlm_midcomms_get_mhandle(node->nodeid, mb_len, &ppc);
if (!mh) if (!mh)
return -ENOMEM; return -ENOMEM;
...@@ -976,13 +975,13 @@ static void midcomms_new_msg_cb(void *data) ...@@ -976,13 +975,13 @@ static void midcomms_new_msg_cb(void *data)
} }
static struct dlm_msg *dlm_midcomms_get_msg_3_2(struct dlm_mhandle *mh, int nodeid, static struct dlm_msg *dlm_midcomms_get_msg_3_2(struct dlm_mhandle *mh, int nodeid,
int len, gfp_t allocation, char **ppc) int len, char **ppc)
{ {
struct dlm_opts *opts; struct dlm_opts *opts;
struct dlm_msg *msg; struct dlm_msg *msg;
msg = dlm_lowcomms_new_msg(nodeid, len + DLM_MIDCOMMS_OPT_LEN, msg = dlm_lowcomms_new_msg(nodeid, len + DLM_MIDCOMMS_OPT_LEN,
allocation, ppc, midcomms_new_msg_cb, mh); ppc, midcomms_new_msg_cb, mh);
if (!msg) if (!msg)
return NULL; return NULL;
...@@ -1001,8 +1000,7 @@ static struct dlm_msg *dlm_midcomms_get_msg_3_2(struct dlm_mhandle *mh, int node ...@@ -1001,8 +1000,7 @@ static struct dlm_msg *dlm_midcomms_get_msg_3_2(struct dlm_mhandle *mh, int node
* dlm_midcomms_commit_mhandle which is a must call if success * dlm_midcomms_commit_mhandle which is a must call if success
*/ */
#ifndef __CHECKER__ #ifndef __CHECKER__
struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, char **ppc)
gfp_t allocation, char **ppc)
{ {
struct midcomms_node *node; struct midcomms_node *node;
struct dlm_mhandle *mh; struct dlm_mhandle *mh;
...@@ -1017,7 +1015,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, ...@@ -1017,7 +1015,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len,
/* this is a bug, however we going on and hope it will be resolved */ /* this is a bug, however we going on and hope it will be resolved */
WARN_ON_ONCE(test_bit(DLM_NODE_FLAG_STOP_TX, &node->flags)); WARN_ON_ONCE(test_bit(DLM_NODE_FLAG_STOP_TX, &node->flags));
mh = dlm_allocate_mhandle(allocation); mh = dlm_allocate_mhandle();
if (!mh) if (!mh)
goto err; goto err;
...@@ -1028,8 +1026,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, ...@@ -1028,8 +1026,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len,
switch (node->version) { switch (node->version) {
case DLM_VERSION_3_1: case DLM_VERSION_3_1:
msg = dlm_lowcomms_new_msg(nodeid, len, allocation, ppc, msg = dlm_lowcomms_new_msg(nodeid, len, ppc, NULL, NULL);
NULL, NULL);
if (!msg) { if (!msg) {
dlm_free_mhandle(mh); dlm_free_mhandle(mh);
goto err; goto err;
...@@ -1040,8 +1037,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, ...@@ -1040,8 +1037,7 @@ struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len,
/* send ack back if necessary */ /* send ack back if necessary */
dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD); dlm_send_ack_threshold(node, DLM_SEND_ACK_BACK_MSG_THRESHOLD);
msg = dlm_midcomms_get_msg_3_2(mh, nodeid, len, allocation, msg = dlm_midcomms_get_msg_3_2(mh, nodeid, len, ppc);
ppc);
if (!msg) { if (!msg) {
dlm_free_mhandle(mh); dlm_free_mhandle(mh);
goto err; goto err;
...@@ -1501,8 +1497,8 @@ int dlm_midcomms_rawmsg_send(struct midcomms_node *node, void *buf, ...@@ -1501,8 +1497,8 @@ int dlm_midcomms_rawmsg_send(struct midcomms_node *node, void *buf,
rd.node = node; rd.node = node;
rd.buf = buf; rd.buf = buf;
msg = dlm_lowcomms_new_msg(node->nodeid, buflen, GFP_NOFS, msg = dlm_lowcomms_new_msg(node->nodeid, buflen, &msgbuf,
&msgbuf, midcomms_new_rawmsg_cb, &rd); midcomms_new_rawmsg_cb, &rd);
if (!msg) if (!msg)
return -ENOMEM; return -ENOMEM;
......
...@@ -16,8 +16,7 @@ struct midcomms_node; ...@@ -16,8 +16,7 @@ struct midcomms_node;
int dlm_validate_incoming_buffer(int nodeid, unsigned char *buf, int len); int dlm_validate_incoming_buffer(int nodeid, unsigned char *buf, int len);
int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int buflen); int dlm_process_incoming_buffer(int nodeid, unsigned char *buf, int buflen);
struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, struct dlm_mhandle *dlm_midcomms_get_mhandle(int nodeid, int len, char **ppc);
gfp_t allocation, char **ppc);
void dlm_midcomms_commit_mhandle(struct dlm_mhandle *mh, const void *name, void dlm_midcomms_commit_mhandle(struct dlm_mhandle *mh, const void *name,
int namelen); int namelen);
int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr, int len); int dlm_midcomms_addr(int nodeid, struct sockaddr_storage *addr, int len);
......
...@@ -55,7 +55,7 @@ static int create_rcom(struct dlm_ls *ls, int to_nodeid, int type, int len, ...@@ -55,7 +55,7 @@ static int create_rcom(struct dlm_ls *ls, int to_nodeid, int type, int len,
struct dlm_mhandle *mh; struct dlm_mhandle *mh;
char *mb; char *mb;
mh = dlm_midcomms_get_mhandle(to_nodeid, mb_len, GFP_NOFS, &mb); mh = dlm_midcomms_get_mhandle(to_nodeid, mb_len, &mb);
if (!mh) { if (!mh) {
log_print("%s to %d type %d len %d ENOBUFS", log_print("%s to %d type %d len %d ENOBUFS",
__func__, to_nodeid, type, len); __func__, to_nodeid, type, len);
...@@ -75,8 +75,7 @@ static int create_rcom_stateless(struct dlm_ls *ls, int to_nodeid, int type, ...@@ -75,8 +75,7 @@ static int create_rcom_stateless(struct dlm_ls *ls, int to_nodeid, int type,
struct dlm_msg *msg; struct dlm_msg *msg;
char *mb; char *mb;
msg = dlm_lowcomms_new_msg(to_nodeid, mb_len, GFP_NOFS, &mb, msg = dlm_lowcomms_new_msg(to_nodeid, mb_len, &mb, NULL, NULL);
NULL, NULL);
if (!msg) { if (!msg) {
log_print("create_rcom to %d type %d len %d ENOBUFS", log_print("create_rcom to %d type %d len %d ENOBUFS",
to_nodeid, type, len); to_nodeid, type, len);
...@@ -510,7 +509,7 @@ int dlm_send_ls_not_ready(int nodeid, const struct dlm_rcom *rc_in) ...@@ -510,7 +509,7 @@ int dlm_send_ls_not_ready(int nodeid, const struct dlm_rcom *rc_in)
char *mb; char *mb;
int mb_len = sizeof(struct dlm_rcom) + sizeof(struct rcom_config); int mb_len = sizeof(struct dlm_rcom) + sizeof(struct rcom_config);
mh = dlm_midcomms_get_mhandle(nodeid, mb_len, GFP_NOFS, &mb); mh = dlm_midcomms_get_mhandle(nodeid, mb_len, &mb);
if (!mh) if (!mh)
return -ENOBUFS; return -ENOBUFS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment